DEV Community

Discussion on: February 11th, 2021: What did you learn this week?

Collapse
 
juniordevforlife profile image
Jason F

I learned how useful git stash save and git stash apply can be.

Collapse
 
nickytonline profile image
Nick Taylor

Awesome!

Hackerman from Kung Fury putting on a Nintendo Power glove

Collapse
 
saurabhnigam profile image
saurabhnigam • Edited

Is git stash different from git stash save?

Collapse
 
juniordevforlife profile image
Jason F

With git stash save you are able to add a message to your stash, almost like a commit message. It would like something like git stash save "stashing my changes". This makes it easier to know which stash is which when you run git stash list. You can then pick which stash to use with the git stash apply command. You would just need to provide which stash from the list using syntax like git stash apply stash@{2}. The 2 is the id of the stash, which you can see when you run git stash list.