Skip to content

HEAD

← All terms · Git fundamentals

A special pointer in Git that indicates the currently checked-out branch or specific commit you are viewing in your working directory.

What it is

HEAD acts as your "current location" indicator within a Git repository. Usually, HEAD points to the name of your active branch. If you check out an old, specific commit instead of a branch, you enter a "detached HEAD" state, meaning you are no longer recording changes to an active timeline.

When you would use it

You reference HEAD when writing terminal commands that need to target the very latest commit of the branch you are actively working on.

Common operations

  • Tracking which branch is currently active.
  • Referencing the most recent commit on the current branch (e.g., reverting HEAD~1).

Related terms

Where this is taught

No learning path uses this term yet. Browse the Learning Atlas for guided sequences through related ideas.

Going deeper