git stash
Showed to me by Xavier during my internship at NVIDIA. Actually quite powerful once you get to understand how to use it.
Resources
To see the actual file diffs, add the -p
flag
Viewing your stashes
git stash list
Storing Stashes
Xavier uses this command
From the tutorial, there is
Both are very similar. The difference between save
and push
:
git stash save
accepts a single non-option argument — the stash messagegit stash push
accepts the message with option-m
and accepts a list of files to stash as arguments
Applying Stashes
Afterwards, when it comes to using your stashes, you can do
Difference with
git stash pop
?I used to use
git stash pop
. The difference is thatapply
keeps it in the stash history, whereaspop
removes it.
If you have multiple stashes, you can do this
Checking out specific files: