Normally, after releasing the product for customer, we will create a tag to mark the time and the version which we released. Sometime, you need to delete a tag because something wrong with the tag or just because you want re-tag with same name. In this tutorial, I will guide you all how we can delete a tag in GIT.
Assume, I have a project questions-management on GitHub and this project has tag as below:
Now, I will delete this tag.
To do this, first of all we need clone remote repository to your local machine, then using some following commands:
- Remove this tag on local using command:
1 |
git tag -d <tag_name> |
Example:
1 |
git tag -d example_tag |
Result:
- Remove this tag on remote repository
1 |
git push origin :refs/tags/<tag_name> |
Example:
1 |
git push origin :refs/tags/example_tag |
Result:
- Update all tags into remote repository.
1 |
git push origin --tags |
Result:
After finishing this step, you can check the result: