Course contentsShow
← Computer Science
Lesson 2202 of 2,87249. Version Control with GitFree lesson

Release Tagging and Versioning

Understand how to mark specific commits as releases using tags and semantic versioning.

Release Tagging and Versioning

What you'll learn: How to mark specific commits as official releases using Git tags and follow semantic versioning conventions.

Why Tag Releases?

In a Git repository with hundreds or thousands of commits, how do you identify which commit represents version 1.0.0 of your software? That's where tags come in—they're permanent labels you attach to specific commits to mark milestones like releases.

Think of tags like bookmarks in a very long book. While branches move forward as you add commits, tags stay anchored to one specific point in history, making it easy to find and reference that exact state of your codebase.

Creating Tags in Git

Git supports lightweight and annotated tags. For releases, use annotated tags because they store metadata:

git tag -a v1.0.0 -m "Release version 1.0.0"

This creates a tag named v1.0.0 at your current commit. You can also tag past commits:

git tag -a v0.9.0 -m "Beta release" abc1234

Semantic Versioning

The standard format for version numbers is MAJOR.MINOR.PATCH (e.g., 2.3.1):

  • MAJOR: Increment when you make breaking changes
  • MINOR: Increment when you add backwards-compatible features
  • PATCH: Increment for backwards-compatible bug fixes

This predictable scheme helps users understand what changed between versions at a glance.

Pushing and Sharing Tags

Tags aren't pushed automatically with git push. Share them explicitly:

git push origin v1.0.0
# or push all tags
git push origin --tags

Key Takeaway: Tags let you mark important commits as releases, and semantic versioning provides a universal language for communicating the nature of changes between versions—together they make release management clear and predictable.