Git Glossary
An overview of concepts & terms around Git & Version Control
Git Glossary featured image

What is "HEAD" in Git?

When working with Git, only one branch can be checked out at a time - and this is what's called the "HEAD" branch. Often, this is also referred to as the "active" or "current" branch.

Git makes note of this current branch in a file located inside the Git repository, in .git/HEAD. (This is an internal file, so it should not be manually manipulated!)
If you wonder what exactly this file contains, you can simply have its contents printed on the command line:

$ cat .git/HEAD
ref: refs/heads/master

In this example case, a local branch named "master" is the current HEAD.

The Git Cheat Sheet

No need to remember all those commands and parameters: get our popular "Git Cheat Sheet" - for free!

Detached HEAD

In rare cases, the HEAD file does NOT contain a branch reference, but a SHA-1 value of a specific revision. This happens when you checkout a specific commit, tag, or remote branch. Your repository is then in a state called Detached HEAD.


The HEAD in Tower

In case you are using the Tower Git client, changing the HEAD branch is easy as pie. Simply double-click a branch in the sidebar to make it the new HEAD branch - or choose a branch from a list.

Learn More

About Us

As the makers of Tower, the best Git client for Mac and Windows, we help over 100,000 users in companies like Apple, Google, Amazon, Twitter, and Ebay get the most out of Git.

Just like with Tower, our mission with this platform is to help people become better professionals.

That's why we provide our guides, videos, and cheat sheets (about version control with Git and lots of other topics) for free.