What is HEAD in Git?

后端 未结 22 2429
野的像风
野的像风 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:57

    I recommend this definition from github developer Scott Chacon [video reference]:

    Head is your current branch. It is a symbolic reference. It is a reference to a branch. You always have HEAD, but HEAD will be pointing to one of these other pointers, to one of the branches that you're on. It is the parent of your next commit. It is what should be what was last checked-out into your working directory... This is the last known state of what your working directory was.

    The whole video will give a fair introduction to the whole git system so I also recommend you to watch it all if have the time to.

提交回复
热议问题