如果我做git checkout my-super-branch
git告诉我:
error: Your local changes to the following files would be overwritten by checkout:
somedir/somefile.py
Please, commit your changes or stash them before you can switch branches.
Aborting
有没有一种简单的方法告诉git自动执行stash + pop?
Git允许Pipelining操作:
git stash && git fetch && git checkout your-branch && git stash apply
当我使用stash
时,你的更改仍然在git stash apply
。
解决冲突(如果有的话)。
如果您希望在上面的呼叫之后从存储中删除您的更改:
git stash drop
否则你可以使用git stash pop