[Git] How to delete tag in Git

There are some situations in which you would like to delete a tag in git like missing some critical update in tag.
It’s not recommended that you delete a tag, but sometimes it comes in handy

Let’s see how to delete a tag. Suppose you have a tag Release-1.0 and want to delete it

$git pull
$git tag
$git tag -d Release-1.0
$git push origin :refs/tags/Release-1.0

1st line is to ensure you pull all the changes locally
2nd line displays all the tags
3rd line deletes the tag locally
4th lines pushes the tag deletion to remote repo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.