A branch moves with new commits, a tag stays fixed, a commit is the immutable snapshot both point to.
Aspect | Branch | Tag | Commit |
|---|
Moves with commits | Yes | No (usually) | No |
Points to | Latest commit | Specific commit | Its parent |
Mutable | Yes | Usually not | No |
Typical use | Parallel work | Release marker | Snapshot |
Under the hood | .git/refs/heads/*
| .git/refs/tags/*
| .git/objects/*
|