HEAD

What is HEAD in Git?

Search for: What is HEAD in Git?

HEAD refers to the current branch (that is checked out)

For example you can do "cat .git/HEAD" it will have "ref: refs/heads/master"

Each branch then refers to its latest commit point

An intermediate commit point of a branch can have a tag

A HEAD, if not otherwise specified, only refers to a branch that is current and indirectly points to the head of that current branch.

A HEAD can be made point to an intermediate commit point of the current branch or a tagged commit point of another branch. In such cases it is called a detached HEAD

Here is a wonderful description of Detached HEAD

I have talked more about this while talking about Branches

I have talked about this with "Checkout" as well

And it is switched to a different branch with checkout

it is synonymous with checking out a branch