git stash show -p返回致命错误

时间:2017-01-10 21:04:19

标签: git

当我运行git stash list时,我得到以下内容:

stash@{0}: WIP on mybranch: 123456f Generic comment here.
stash@{1}: WIP on mybranch: 234567g Generic comment here.
...
stash@{n}: WIP on mybranch: 345678h Generic comment here.

这是预期的行为。令我神秘的是git show的行为。

当我在我的仓库中运行git stash show -p stash@{1}时,我收到以下错误:

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

这怎么可能?我在git repo中运行git stash show -p stash@{1}

1 个答案:

答案 0 :(得分:1)

贝壳正在吃掉我自己的花括号。

git stash show -p stash@'{1'}有效。

具有讽刺意味的是,这是回答我问题的最低评价@ Is it possible to preview stash contents in git?

奇怪,因为错误报告了带花括号的命令。你希望它在没有它们的情况下报告。

相关问题