Sandeep Raju Prabhakar Sandeep Raju Prabhakar - 1 year ago 123
Git Question

Difference between git stash pop and git stash apply

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 the same as
git stash pop

What is the difference between
git stash pop
git stash apply

Answer Source

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).

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download