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
git stash show <stash_id>To see the actual file diffs, add the -p flag
git stash show -p <stash_id>Viewing your stashes
git stash list
Storing Stashes
Xavier uses this command
git stash push -m "tag_name"From the tutorial, there is
git stash save "add style to website"Both are very similar. The difference between save and push:
git stash saveaccepts a single non-option argument — the stash messagegit stash pushaccepts the message with option-mand accepts a list of files to stash as arguments
Applying Stashes
Afterwards, when it comes to using your stashes, you can do
git stash applyDifference with
git stash pop?I used to use
git stash pop. The difference is thatapplykeeps it in the stash history, whereaspopremoves it.
If you have multiple stashes, you can do this
git stash apply stash@{1} Checking out specific files:
git checkout stash@{1} -- /path/to/file1 /path/to/file2 ...