You can delete a git tag locally by using the git tag
command with the -d
flag (or --delete
), for example, like so:
git tag -d <tag-name>
For example, if you wanted to delete a tag called "v1.5.0
", you would do it like so:
git tag -d v1.5.0
If the tag is successfully deleted, you will see an output similar to the following:
Deleted tag 'v1.5.0' (was 80c6ed6)
If the tag you're trying to delete does not exist locally, then it will result in the following error:
error: tag 'v1.5.0' not found.
Please note that this does not affect tags on your remote. You have to use a different git command to remove a tag from your remote repository.
Hope you found this post useful. It was published . Please show your love and support by sharing this post.