Difference between git stash pop and git stash apply

前端 未结 7 807
忘了有多久
忘了有多久 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:58

    Got this helpful link that states the difference, as John Zwinck has stated and a drawback of git stash pop.

    For instance, say your stashed changes conflict with other changes that you’ve made since you first created the stash. Both pop and apply will helpfully trigger merge conflict resolution mode, allowing you to nicely resolve such conflicts… and neither will get rid of the stash, even though perhaps you’re expecting pop too. Since a lot of people expect stashes to just be a simple stack, this often leads to them popping the same stash accidentally later because they thought it was gone.

    Link: http://codingkilledthecat.wordpress.com/2012/04/27/git-stash-pop-considered-harmful/

    0 讨论(0)
提交回复
热议问题