git分支实验 [英] git branching experimental

查看:110
本文介绍了git分支实验的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为一个项目工作。今天我正在尝试Windows特定 wchar ,我需要做更改很多代码,从早上,我结束了一个丑陋的混乱。我可以清除后者,但现在我需要做一些主流工作上一次工作提交。但我不想松开这项工作。

Well I've been working for a project. today I was experimenting with windows specific wchar and I needed to do change a lot of code since morning and I ended up with an ugly mess. That I can clear out latter but right now I need to do some mainstream works on last working commit. But I don't want to loose this work. So how can I keep this work in some branch for future and revert my workspace back to last commit ?

推荐答案

您可以创建一个新分支并提交您的更改:

You can create a new branch and commit your changes to it:

git checkout -b topic/ugly-mess
git commit -a -m 'Checkpointing mess.'

然后回到你最后一次提交的主流分支:

Then go back to your mainstream branch which has the last working commit:

git checkout master


b $ b

如果你想要在上游发布你的local mess,请按下面的分支:

If you want your to publish your "local mess" upstream, push the branch:

git push origin topic/ugly-mess

这篇关于git分支实验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆