Tag Creation Techniques
Lightweight Tag Creation
Lightweight tags are simple references to specific commits, created without additional metadata:
## Create lightweight tag at current commit
git tag v1.0.0
## Create lightweight tag at specific commit
git tag v1.0.1 <commit-hash>
Annotated Tag Creation
Annotated tags provide comprehensive information about the release:
## Create annotated tag with message
git tag -a v1.2.0 -m "Production Release"
## Create annotated tag with detailed message
git tag -a v1.2.1 -m "Hotfix: Critical Security Update
- Resolved authentication vulnerability
- Improved error handling"
Semantic Versioning Techniques
graph LR
A[Major Version] --> B[Minor Version]
B --> C[Patch Version]
Version Format |
Meaning |
Example |
Major.Minor.Patch |
Structured versioning |
1.2.3 |
v-prefix |
Optional version prefix |
v1.2.3 |
Advanced Tag Creation Strategies
## Tag with specific commit reference
git tag -a v1.3.0 9fceb02 -m "Specific Commit Tag"
## List all tags
git tag
## Verify tag details
git show v1.3.0
Tag Naming Best Practices
- Use semantic versioning
- Maintain consistent naming conventions
- Include meaningful release descriptions
- Follow project-specific versioning standards