如果我运行 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操作?
stash pop
可能是一种危险的操作,你真的不应该将其作为自动步骤。应用一个 stash 可能会导致冲突,需要手动解决,如果你使用了stash pop
,那么原始的 stash 就不存在了,所以你没有办法回到之前的状态。 - pokepop
的原因) - poke