How to remove all git origin and local tags?

Amir Hosseinzadeh picture Amir Hosseinzadeh · Jun 22, 2017 · Viewed 33.8k times · Source

How do you remove a git tag that has already been pushed? Delete all git remote (origin) tags and Delete all git local tags.

Answer

Amir Hosseinzadeh picture Amir Hosseinzadeh · Jun 22, 2017

1. Delete All local tags. (Optional Recommended)

git tag -d $(git tag -l)

2. Fetch remote All tags. (Optional Recommended)

git fetch

3. Delete All remote tags.

git push origin --delete $(git tag -l) # Pushing once should be faster than multiple times

4. Delete All local tags.

git tag -d $(git tag -l)