I just upgraded git. I'm on git version 1.8.3.
This morning I tried to unstash a change 1 deep in the stack.
I ran git stash pop stash@{1}
and got this error.
fatal: ambiguous argument 'stash@1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
I've tried about 20+ variations on this as well as using apply
instead of pop
with no success. What's changed? Anyone else encounter this?
As pointed out previously, the curly braces may require escaping or quoting depending on your OS, shell, etc.
See "stash@{1} is ambiguous?" for some detailed hints of what may be going wrong, and how to work around it in various shells and platforms.
git stash apply version
As Robert pointed out, quotation marks might do the trick for you:
If you want to be sure to not have to deal with quotes for the syntax
stash@{x}
, use Git 2.11 (Q4 2016)See commit a56c8f5 (24 Oct 2016) by Aaron M Watson (
watsona4
).(Merged by Junio C Hamano --
gitster
-- in commit 9fa1f90, 31 Oct 2016)So:
If none of the above work, quotation marks around the stash itself might work for you:
First check the list:-
copy the index you wanted to pop from the stash list
eg.:
On Windows Powershell I run this: