Delete all tags from a Git repository

Question

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

git tag | xargs git tag -d

Simply follow the Unix philosophy where you pipe everything.

On Windows use git bash with the same command.

Can I 'git commit' a file and ignore its content changes?

How can I undo git reset --hard HEAD~1?