Member-only story
How to Add a Tag to a Commit in Git
Tags in Git are like bookmarks in your version history. They allow you to label specific commits with meaningful names, making identifying important points in your project’s timeline easier — such as a release or a milestone.
In this post, we’ll walk you through adding tags to commits in Git, verifying them, and sharing them with others.
Read the full story here: https://allwin-raju-12.medium.com/how-to-add-a-tag-to-a-commit-in-git-574405cba28a?sk=94f08639253182e60154b875ca94d69f
What Are Tags in Git?
Tags in Git are pointers to a specific commit. There are two primary types of tags:
- Lightweight Tags: A simple pointer to a commit with no additional information.
- Annotated Tags: A pointer to a commit that includes extra metadata, such as the tagger’s name, email, date, and message.
Step-by-Step Guide to Adding a Tag
1. Find the Commit to Tag
First, ensure you’re targeting the correct commit. You can tag the current commit or specify a commit hash if you need to tag something in the past.