Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git stash apply @stash{x} not working for me

Tags:

git

I am trying to apply a specific stash using:

git stash apply stash@{2}

But end up with this error:

fatal: ambiguous argument 'stash@': unknown revision or path not in the working tree.

I have plenty of stashed entries, over 20 if I do a git stash list

I am unsure what this error is trying to tell me, can someone advise further? Thanks

like image 628
mindparse Avatar asked Jul 08 '15 15:07

mindparse


1 Answers

You need to quote the string, because your shell is eating the content of the {} as an expansion. So use git stash apply 'stash@{2}'. Alternatively you can use the SHA of the stash, or next time when you apply it, you can name the stash yourself.

like image 198
AlBlue Avatar answered Sep 27 '22 16:09

AlBlue