Difference Between Git Stash Pop And Git Stash Apply

443    Asked by Amitraj in Data Science , Asked on Nov 16, 2022

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 and git stash apply?

Answered by Al German

The key difference between git stash pop and git stash apply involves the stash history. When a developer uses the git stash apply command, the most recently saved stash overwrites files in the current working tree but leaves the stash history alone. In contrast, the pop command restores files but then deletes the applied stash.


Your Answer

Interviews

Parent Categories