0 votes
1 view
in Devops and Agile by (29.3k points)
edited by

You see the Git documentation saying things like

The branch must be fully merged in HEAD.

But what is Git HEAD exactly?

1 Answer

0 votes
by (50.2k points)

HEAD: you can assume this as the current branch on which we are on. If you check out the branch using git checkout then the head is also pointed to the new branch.

In simple terms, we can say HEAD is a pointer to the branch which we are currently on.

To see where the HEAD points to by using 

cat .git/HEAD

It is possible for HEAD to refer to a specific revision that is not associated with a branch name. This situation is called a detached HEAD.

Reference: https://git-scm.com/docs/git-checkout 

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...