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.
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.
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.
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.