by BehindJava

What is Git Tagging

Home » interview » What is Git Tagging

In this tutorial, we are going to learn about Git Tagging in detail.

Git Tagging

This is used to place book marks on important commits. Generally it used to identify the commits that are related to release events.

GIt Tagging is classified into 2 types

  1. Light Weight Tags
  2. Annoted Tags

Light weight tags

  1. These tags only have a tag name.
  2. To create a light weight tag to the latest commit.

    git tag some_tag_name
  3. To create a light weight tag to an older commit.

    git tag some_tag_name older_commit_id

Annoted Tags

  1. To create an annoted tag to the latest commit.

    git tag -a "some_tag_name" -m "some msg related to the tag"
  2. To create an annoted tag for an older commit.

    git tag -a "some_tag_name" -m "some msg related to the tag" older_commit_id

To see the list of all tags.

git tag

To push the tags into remote github.

git tags --push

To delete a tag locally.

git tag -d tagname

To delete a tag from remote github.

git push origin :tag_name