How to remove all git tags in the remote

1075 viewsOther
Phillip S (anonymous) admin approved

We have a large list of Git tags, currently synched to the git remote. Removing tags one by one seem very time consuming. Is there a way to remove them all in a single command?


Removing of all git tags in the remote (the commands should be executed from a local environment) could be achieved in these few simple steps:

  1. Delete all local tags:  git tag -d $(git tag -l)
  2. Fetch all tags from the remote  git fetch
  3. Delete all tags in the remote  git push origin --delete $(git tag -l)
  4. Repeat deleting all local tags  git tag -d $(git tag -l)

After these four steps, all remote and local tags will be deleted.

Write your answer.