Git tags are essential markers in version control that provide a way to capture specific points in a repository's history. They are primarily used to highlight important milestones such as software releases, version snapshots, and critical commit points.
Git tags are references that point to specific commits in a repository's timeline. Unlike branches, tags do not change and remain fixed at a particular commit, making them ideal for marking release versions and significant project states.
gitGraph
commit
commit
commit
tag: v1.0.0
commit
commit
tag: v1.1.0
There are two primary types of Git tags:
Tag Type |
Description |
Use Case |
Lightweight Tags |
Simple references to specific commits |
Quick, temporary marking |
Annotated Tags |
Full objects with metadata |
Official releases, detailed versioning |
Basic Tag Usage in Ubuntu 22.04
Create a lightweight tag:
git tag v1.0.0
Create an annotated tag with message:
git tag -a v1.1.0 -m "First stable release"
List existing tags:
git tag
View tag details:
git show v1.0.0
Tags help developers track software versions, manage release cycles, and provide clear reference points in complex project histories.