A Branch Is Just a Pointer
The single mental model that makes Git click. Don't take my word for it — drag the slider and watch the history grow.
People treat branches as if they were heavy copies of a project. They aren’t. A branch is a movable pointer at a single commit1. Adding a commit just moves the pointer forward.
Notice what didn’t happen when you toggled the branch: nothing got copied. feature
is just another label, sitting on the same underlying commits until you add to it.
HEAD is a pointer to a pointer — it usually points at whichever branch you’re “on”.
Checking out a branch just moves HEAD; checking out a commit directly is what puts
you in “detached HEAD”.
Once you see branches as cheap labels over an append-only graph of snapshots, the scary operations get small: merge writes a commit with two parents, and rebase replays your commits onto a new base, moving the label when it’s done.