Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
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.


Related questions

Browse Categories