Git is an essential tool for developers and teams to manage source code and collaborate efficiently. While most developers are familiar with Git basics like commits, branches, and merges, many overlook two powerful features: Git Tags and Releases.
In this blog, we’ll dive deep into:
- What Git Tags are
- The difference between lightweight and annotated tags
- How to create, manage, and delete tags
- The concept of GitHub Releases (and GitLab/Bitbucket equivalents)
- Best practices for tagging and versioning
- Real-world use cases
What are Git Tags?
Git tags are references that point to specific points in Git history. Typically, they are used to mark important milestones in your project — like version 1.0.0 or the final release before a big change.
Think of tags as bookmarks or labels for commits.
Use case example: You want to mark the commit that represents version
v2.0.0
of your application so that anyone can reference it in the future.
Types of Git Tags
There are two main types of Git tags:
1. Lightweight Tag
A lightweight tag is like a bookmark to a commit. It doesn’t store extra information like the tagger’s name, date, or message.
tag v1.0.0
2. Annotated Tag
Annotated tags are stored as full objects in the Git database. They include:
- Tagger name
- Tagging date
- Tag message
- Optionally, a GPG signature
tag -a v1.0.0 -m "Release version 1.0.0"
Best Practice: Use annotated tags for releases. They are more informative and can be signed for security.
How to Work with Git Tags
Create a Tag
- Lightweight tag: bashCopyEdit
git tag v1.0.0
- Annotated tag: bashCopyEdit
git tag -a v1.0.0 -m "First stable release"
Tag a Specific Commit
You can also tag a specific commit (not just HEAD):
View Tags
tag
To search for a specific tag pattern:
tgit tag -l "v1.*"
Push Tags to Remote
Tags are not pushed automatically.
- To push a single tag: bashCopyEdit
git push origin v1.0.0
- To push all tags: bashCopyEdit
git push origin --tags
Delete a Tag
- Locally: bashCopyEdit
git tag -d v1.0.0
- Remotely: bashCopyEdit
git push origin --delete v1.0.0
GitHub (or GitLab) Releases
Git tags become even more powerful when combined with GitHub Releases.
What is a Release?
A release is a GitHub (or GitLab) feature that builds on Git tags. It lets you:
- Publish release notes
- Attach binaries or source code
- Notify users of a new version
- Provide links to download specific versions
How to Create a Release on GitHub
- Go to your repository.
- Click on “Releases” tab.
- Click “Draft a new release”.
- Choose a tag (existing or new).
- Add a title and description (changelog, highlights).
- Optionally, attach files like binaries or zip folders.
- Click “Publish release”.
This is great for versioning apps, libraries, or tools with downloadable assets.
Real-World Use Cases for Git Tags and Releases
Marking Versions
Each release of your software (v1.0.0, v2.1.3, etc.) can be tagged, making it easy to roll back or deploy specific versions.
Automated CI/CD
CI/CD pipelines can be triggered based on new tags (e.g., deploying a build when a new release tag is pushed).
Distribution
You can bundle tagged releases with compiled binaries or release notes, useful for software distributions or plugin updates.
Semantic Versioning and Tag Naming
Follow the Semantic Versioning (SemVer) standard:
MAJOR.MINOR.PATCH
- MAJOR: Breaking changes
- MINOR: Backward-compatible new features
- PATCH: Bug fixes
Examples:
v1.0.0
– first stable releasev1.1.0
– added a new featurev1.1.1
– fixed a bug
Use prefixes like
v
(e.g.,v1.0.0
) to clearly mark versions.
Pro Tips & Best Practices
- Use annotated tags for official releases.
- Always push tags after tagging, or your team won’t see them.
- Don’t use tags for temporary bookmarks — use branches instead.
- Protect release tags from accidental deletion.
- Sign tags with GPG if you want verified authenticity.
Conclusion
Git tags and releases are underused but extremely powerful tools that help you manage versions, deploy reliably, and communicate clearly with users or collaborators.
Whether you’re building apps, libraries, or open-source tools, integrating proper tagging and release workflows will make your development more professional and future-proof.