Thanks for this great post, I learned a lot! It’s worth noting that git stash apply does the same thing as git stash pop except it’s non-destructive and doesn’t delete the stashed changes from your stash history! That way if you mess up while re-adding changes from the stash (which has happened to me before, especially during a stash merge conflict), you can easily re-implement the same stashes changes! Definitely would recommend as a preferred command.
This is why I love the DEV community - you learn something new every day...
Thanks to you, this is what I learned today: git stash pop is git stash apply && git stash drop. git stash pop applies the top stash and removes it, while git stash apply does the same but leaves the stash in the stack.
Therefore, it is recommended to use $ git stash apply in this use case - I will update the post :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for this great post, I learned a lot! It’s worth noting that
git stash apply
does the same thing asgit stash pop
except it’s non-destructive and doesn’t delete the stashed changes from your stash history! That way if you mess up while re-adding changes from the stash (which has happened to me before, especially during a stash merge conflict), you can easily re-implement the same stashes changes! Definitely would recommend as a preferred command.This is why I love the DEV community - you learn something new every day...
Thanks to you, this is what I learned today:
git stash pop
isgit stash apply && git stash drop
. git stash pop applies the top stash and removes it, while git stash apply does the same but leaves the stash in the stack.Therefore, it is recommended to use
$ git stash apply
in this use case - I will update the post :)