Delete all tags from a Git repository

Ionică Bizău picture Ionică Bizău · Oct 23, 2013 · Viewed 65.6k times · Source

I want to delete all the tags from a Git repository. How can I do that?

Using git tag -d tagname delete the tag tagname locally, and using git push --tags I update the tags on the git provider.

I tried:

git tag -d *

But I see that * means the files from the current directory.

$ git tag -d *
error: tag 'file1' not found.
error: tag 'file2' not found.
...

Consider I have a lot of tags, and I want to delete them, all.

Answer

Florian Margaine picture Florian Margaine · Oct 23, 2013
git tag | xargs git tag -d

Simply use the Linux philosophy where you pipe everything. On Windows use git bash with the same command.