
Why use Git tags?
- Create immutable release points for reproducibility
- Simplify collaboration by referencing a specific state of the code
- Automate deployments by targeting a tag in your pipeline
Types of Git tags
| Tag Type | Description | Typical Use Case |
|---|---|---|
| Lightweight | A simple ref to a commit | Quick local markers |
| Annotated | A full Git object (message, author, timestamp) | Official release versions |
Annotated tags include metadata—such as the tagger’s name, date, and a descriptive message—making them ideal for public releases.
Creating tags
Listing all tags
Pushing tags to remote
Avoid force-pushing or rewriting existing tags, as this can lead to inconsistencies in collaborators’ repositories.
Checking out a tag
To view or revert to a tagged commit:Sorting tags by semantic version
v1.10 appears after v1.2.