Tag Creation Techniques
Git offers two primary tag creation techniques, each serving distinct purposes in version control and release management.
Lightweight tags are simple references to specific commits without additional metadata.
## Create lightweight tag
git tag v1.0.0
## Create lightweight tag for specific commit
git tag v1.1.0 abc123
Annotated tags store comprehensive information about the tag and its creator.
## Create annotated tag with message
git tag -a v1.2.0 -m "Production release"
## Create annotated tag with more details
git tag -a v1.2.1 -m "Bugfix release" -m "Resolved critical security issue"
Tag Naming Conventions
Naming Convention |
Example |
Description |
Semantic Versioning |
v1.2.3 |
Major.Minor.Patch |
Date-based |
v2023.06.15 |
Release date format |
Feature-based |
v1.0-login-module |
Feature-specific tags |
Advanced Tag Creation Techniques
graph LR
A[Tag Creation] --> B{Tag Type}
B -->|Lightweight| C[Quick Reference]
B -->|Annotated| D[Detailed Metadata]
D --> E[Include Author]
D --> F[Add Descriptive Message]
Practical Tagging Scenarios
## Tag current commit
git tag v1.3.0
## Tag a specific commit
git tag v1.3.1 9fceb02
## Create annotated tag with signature
git tag -s v1.4.0 -m "Signed release"
The tag creation process allows developers to mark significant points in project history, enabling precise version tracking and release management.