我查看了所有其他模棱两可的refname问题,但它们似乎都没有帮助.为什么我收到这个警告?
$ git checkout master
warning: refname 'master' is ambiguous.
$ git show-ref master
eef61c00da690f093063ac5a728e22fd21648104 refs/heads/master
$ git branch -a
checkers
exercises
* master
$ git remote -v
$
Run Code Online (Sandbox Code Playgroud) 如果我仅使用分支名称签出分支,HEAD则更新为指向该分支.
$ git checkout branch
Switched to branch 'branch'
Run Code Online (Sandbox Code Playgroud)
如果我使用refs/heads/branch或签出分支heads/branch,则HEAD变为分离.
$ git checkout refs/heads/branch
Note: checking out 'refs/heads/branch'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
$ git checkout "refs/heads/branch"
Same result
$ git checkout heads/branch
Same result
Run Code Online (Sandbox Code Playgroud)
为什么?如果它的版本依赖,我在Ubuntu 12.04.3上有git 1.7.9.5.