存储@ {1}不明确? [英] stash@{1} is ambiguous?
问题描述
我试图获取有关我的存储空间的信息,但是git告诉我:存储@ {0}
和存储@ {1}
不明确。 git stash list
正常工作,并且 .git / logs / refs / stash
似乎有适当的内容
I'm trying to get info about my stash, but git is telling me that stash@{0}
and stash@{1}
are ambiguous. git stash list
works fine, and .git/logs/refs/stash
seems to have the appropriate content (not that I'm an expert on git internals).
% git stash list
stash@{0}: On master: two
stash@{1}: On master: one
% git stash show stash@{1}
fatal: ambiguous argument 'stash@1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
只需简单地 git存储显示
工作正常。那么为什么名称 git stash list
让我认为是不明确的?
Just plain git stash show
works fine. So why are the names that git stash list
gives me considered ambiguous?
推荐答案
你的shell正在吃你的花括号,所以当你说 stash @ {1}
时,git会看到 stash @ 1
而且这没有意义。引用参数(使用 git stash applystash @ {1}
)或者重新配置你的shell,只在它们之间有逗号时展开大括号(zsh可以配置无论哪种方式,bash只会在逗号或范围之间扩展大括号,其他shell可能表现为一种或其他方式)。
Your shell is eating your curly brackets, so while you say stash@{1}
, git sees stash@1
and that makes no sense to it. Quote the argument (use git stash apply "stash@{1}"
) or reconfigure your shell to only expand curly brackets when there is a comma between them (zsh can be configured either way, bash only expands curly brackets with comma or range between them, other shells may behave one or other way).
这篇关于存储@ {1}不明确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!