DEV Community

Discussion on: How to Git Stash Your Work [the Correct Way]

Collapse
 
peterhric profile image
Peter Hric

I have 1 stash item @{0}
What in the world is the correct syntax to drop it ?
I tried everything possible and impossible, everything is incorrect.
Just one WORKING example, please...

Collapse
 
peterhric profile image
Peter Hric

git stash drop stash@{0}

phew !

I wonder why did they not over complicate it even more:

git stash drop sT4Sh@#$%&(^___{oo)oo}}]]&%&^

Collapse
 
nefira profile image
Nefira

Hello Peter,

Might depend on your version of git, but I think you could use a simpler command such as :

git stash drop 0 (in your precise case, otherwise, replace 0 by the stash id.

This is in fact what is written in the article, but either it wasn't easy to understand without an example, or you have some special configuration of git ? On my machine at least, it works.

Thread Thread
 
nefira profile image
Nefira

I should even add that if you want to delete the last created stash (stash@{0}), you could even just type : git stash drop. But again, that is assuming that you have a default git configuration (I am not too familiar with all the configuration options available). Hope that helps.

Thread Thread
 
peterhric profile image
Peter Hric

Thank you - now I see, GIT indeed is a tool for experts :)