How To Completely Delete Git Tag

GIT
By bhagwatchouhan
How To Completely Delete Git Tag

This post list the commands required to delete a git tag both locally and on the remote server.

 

Delete Tag Locally

The git command tag -d can be used to delete a tag locally.

# Delete local tag
git tag -d <tag name>
# Example - Delete the local tag alpha1 git tag -d alpha1

 

Delete Tag on Remote Server

The git command push can be used to delete a tag on the remote server as shown below for remote server named origin.

# Delete remote tag
git push origin :refs/tags/<tag name>
OR
git push --delete origin <tag name>
# Example - Delete the remote tag alpha1 git push origin :refs/tags/alpha1
OR
git push --delete origin alpha1

Share this blog:

Profile picture for user bhagwatchouhan
bhagwatchouhan