Skip to content
BENIBIX Learn

Git Tag vs Branch

People think a tag is just another kind of branch, since both are names on a commit. A branch moves forward each time you commit on it. A tag never moves, so v1.0 points at the same code years later. Tags also need a push of their own, because a plain git push does not send them.

Development🔀 Version Control

Git Tag

A fixed name on one commit. It often marks a release, like v1.0.

A Git tag is a fixed name stuck on one commit. It is usually used to mark a release, like v1.0 or v2.3.1. Unlike a branch, a tag never moves when new commits arrive. You can check out a tag any time to see the code exactly as it was released. Tags must be pushed on their own, because a plain git push does not send them.

Example
Lucy tags the commit she ships as v1.0. When a bug report comes in, she checks out v1.0 to see the exact code users have.
Why it matters
Tags tie a version number to the exact code behind it. Bug reports and rollbacks depend on that link.
Full entry
Development🔀 Version Control

Branch

A line of work to one side. Try changes there while main stays safe.

A branch is a separate line of work inside one repository. You make a branch to try a feature or fix a bug without touching the main code. Commits on a branch stay there until you merge them back. The main line is often called main. Making a branch is quick and cheap in Git, so teams make one for almost every task.

Example
Emma makes a branch called dark-mode. She tries a new look for a week, while main stays safe for everyone else.
Why it matters
Branches let many people work at once. Half-done work never breaks the main code.
Full entry

In one line

Git Tag
A fixed name on one commit. It often marks a release, like v1.0.
Branch
A line of work to one side. Try changes there while main stays safe.