git stash apply @stash{x} 不适合我

标签 git

我正在尝试使用以下方式应用特定的存储:

git stash apply stash@{2}

但最终出现这个错误:

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

我有很多 stash 的条目,如果我做一个 git stash list

超过 20

我不确定这个错误试图告诉我什么,有人可以进一步建议吗?谢谢

最佳答案

您需要引用该字符串,因为您的 shell 正在将 {} 的内容作为扩展。所以使用 git stash apply 'stash@{2}'。或者,您可以使用存储的 SHA,或者下次应用时,您可以自己命名存储。

关于git stash apply @stash{x} 不适合我,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31297108/

相关文章:

git - git cherry-pick 是否保存任何元数据?

java - 使用 Grgit 在我的 gradle 上克隆 git 存储库

windows - git,Windows 上的 SSH_ASKPASS

eclipse - Git bash win32异常 : Failed to write credentials

git - 'git add --patch' 来包含新文件?

git - 在没有推送的情况下跨机器同步 Git repos

c# - 有没有办法使用 libgit2sharp 恢复单个文件?

linux - 在 bash 脚本中使用修改后的变量,尝试以编程方式更改 git 分支

xcode - 如何在 Xcode 7 项目中包含 ReactiveCocoa 3.0

ios - Amazon Web Service (AWS) S3,如何上传受密码保护的文件夹?