使用git时突然发现了bug

时间:2012-07-17 09:10:31

标签: git

当我将git切换到分支进行更改时,我突然发现了一个需要修复的错误。 我该怎么办? 我是否需要在excel或纸上记录错误然后将其修复到另一个分支中? 如果是这种情况,我认为git是愚蠢的。

2 个答案:

答案 0 :(得分:3)

如果我的问题正确,您需要git stash,例如

# I have some uncommited changes!
git stash
# now I have a clean working directory, without the uncommited changes. 
# fix Your bug, commit push, etc.
git stash pop
# now my uncommited changes are back! Keep working on the feature

答案 1 :(得分:0)

如果你只需要在另一个分支中修复它,那么创建一个新的克隆并在那里修复它。