Algocraft / Git Commands / git tag

🏷️

git tag

Pin a permanent, human-readable name onto a specific commit — perfect for marking releases

Lightweight Annotated Detached HEAD
Commit Graph Step 0 / 0
Working Directory → Staging → Repository
Terminal Transcript

Key Concepts

🎯 When to Use
  • Marking version releases (v1.0.0, v2.1.3, …)
  • Bookmarking a commit you'll want to find again by name
⚖️ Lightweight vs Annotated
  • Lightweight: just a name pointing at a commit — no metadata
  • Annotated: a full object with tagger, date, and message
  • Use annotated tags for anything you'll actually release
🎓 Pro Tips
  • Tags don't push automatically — use git push --tags
  • Commit while checked out on a tag and you're in detached HEAD — branch it to keep the work