如果我仅使用分支名称签出分支,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.