What is HEAD in Git?

后端 未结 22 2042
野的像风
野的像风 2020-11-22 10:02

You see the Git documentation saying things like

The branch must be fully merged in HEAD.

But what is Git HEAD exac

22条回答
  •  太阳男子
    2020-11-22 10:31

    As a concept, the head is the latest revision in a branch. If you have more than one head per named branch you probably created it when doing local commits without merging, effectively creating an unnamed branch.

    To have a "clean" repository, you should have one head per named branch and always merge to a named branch after you worked locally.

    This is also true for Mercurial.

提交回复
热议问题