Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
>git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master
它们都相同吗,如果是,那么为什么我们有两个。
如果master已签出,HEAD则为master。如果签出另一个分支(或简单的提交)则不是这种情况 - 因为 HEAD 是对您正在进行的当前提交的引用。
master
HEAD
例子:
git checkout wip # Then HEAD == wip git checkout aed24d # Then HEAD == aed24d
HEAD 是一种便利。这是一个助手/快捷方式。 它经常指向 origin/master,但它也可以指向另一个分支提交。