以下来自官方Manual:
Interrupted workflowWhen you are in the middle of something, your boss comes in and demands that you fix something immediately. Traditionally, you would make a commit to a temporary branch to store your changes away, and return to your original branch to make the emergency fix, like this:
# ... hack hack hack ...
$ git checkout -b my_wip
$ git commit -a -m "WIP"
$ git checkout master
$ edit emergency fix
$ git commit -a -m "Fix in a hurry"
$ git checkout my_wip
$ git reset --soft HEAD^
# ... continue hacking ...
You can usegit stashto simplify the above, like this:
# ... hack hack hack ...
$ git stash
$ edit emergency fix
$ git commit -a -m "Fix in a hurry"
$ git stash pop
# ... continue hacking ...
本文介绍了一种使用Git stash简化中断工作流程的方法,帮助开发者快速处理紧急变更,同时保持原有工作进度不受影响。
811

被折叠的 条评论
为什么被折叠?



