by BehindJava
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
- Light Weight Tags
- Annoted Tags
Light weight tags
- These tags only have a tag name.
-
To create a light weight tag to the latest commit.
git tag some_tag_name
-
To create a light weight tag to an older commit.
git tag some_tag_name older_commit_id
Annoted Tags
-
To create an annoted tag to the latest commit.
git tag -a "some_tag_name" -m "some msg related to the tag"
-
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