【发布时间】:2017-01-10 21:04:19
【问题描述】:
当我运行 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 的行为。
当我在我的 repo 中运行 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}。
【问题讨论】:
-
这似乎是不可能的。这意味着
git rev-parse无法将stash@{1}转换为Git 对象ID,而git stash list仅显示stash引用的所有引用日志条目,因此如果它显示stash@{1},则stash@{1}是有效的对象 ID 的名称。 (“在右分支上”部分无关紧要:存储在 no 分支上。) -
哪个 Git 版本显示此错误,以及使用哪个 Git 版本创建(克隆)存储库?
-
git version 1.8.0用于显示错误及其创建的 repo。
标签: git