Difference between git stash pop and git stash apply

前端 未结 7 815
忘了有多久
忘了有多久 2020-11-29 14:21

I\'ve been using git stash pop for quite some time. I recently found out about the git stash apply command. When I tried it out, it seemed to work

7条回答
  •  清酒与你
    2020-11-29 14:40

    git stash pop throws away the (topmost, by default) stash after applying it, whereas git stash apply leaves it in the stash list for possible later reuse (or you can then git stash drop it).

    This happens unless there are conflicts after git stash pop, in which case it will not remove the stash, leaving it to behave exactly like git stash apply.

    Another way to look at it: git stash pop is git stash apply && git stash drop.

提交回复
热议问题