In Git, what actually is a branch?

A lightweight movable pointer to a commit, not a copy of your files.

Start playing free

  1. A full copy of every file
  2. A separate folder on the server
  3. A movable pointer to one commit ✔

Why: Making a branch in Git just creates a small label that points at a commit. When you commit on that branch, the label moves forward. That is why branching in Git is nearly instant.

Huh, didn't know that: Git knows which branch you are on through a special pointer called HEAD.

The dad joke
I asked Git for a new branch. It handed me a sticky note pointing at a commit.
Like this card?
Play the game

References

Answer: A movable pointer to one commit. Making a branch in Git just creates a small label that points at a commit. When you commit on that branch, the label moves forward. That is why branching in Git is nearly instant.

  1. Pro Git book: Branches in a Nutshell git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell
    A branch in Git is simply a lightweight movable pointer to one of these commits.
    Checked 2026-10-10.

Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.

Test yourself in the game