What is a Branch
A branch is a named pointer to a commit. It is stored as a file in .git/refs/heads/ containing a 40-character SHA-1 hash plus a newline — 41 bytes total.
How it works
git branch feature creates the file .git/refs/heads/feature with the current commit's hash. No files are copied. No trees are duplicated. Creating a branch is O(1) regardless of project size.
When you commit on a branch, Git advances that branch's ref to the new commit. Other branches are unaffected — they still point to their original commits. This is why Git branches are "cheap": creating and switching between branches involves only reading and writing tiny ref files.
Deleting a branch (git branch -d feature) removes the ref file. The commits it pointed to still exist in the object database — they are not deleted until garbage collection prunes unreachable objects.
Why it matters
Branch cheapness changes workflows. In centralized version control, branches were expensive (full directory copies), so teams shared long-lived branches. In Git, branches are free, so every feature, bug fix, and experiment gets its own branch. Short-lived branches reduce merge conflicts and enable isolated development.
See How Git Branching Works for the complete explanation of refs, HEAD, and branch mechanics.