Git: Delete Tags From Both Local and Remote Repositories

Tyler Tyler (275)
0

Cleaning up unused tags is an important part of Git housekeeping. This guide will show you how to delete tags from both local and remote Git repositories.

tl;dr

git push --delete origin <tag_name>
git tag -d <tag_name>

Continue reading to see a breakdown of each command.

Posted in these interests:

git
PRIMARY
15 guides
code
65 guides

As of Git 1.7.0 you can use git push --delete to delete a remote branch or tag.

git push --delete <remote_name> <tag_name>

In most cases, the remote name is origin, so you'll use:

git push --delete origin <tag_name>

Deleting a tag from your local repository is easy:

git tag -d <tag_name>

So, git tag -a <tag_name> adds a tag, and git tag -d <tag_name> deletes a tag.