Deleting Git Tags Locally and on Github


Deleting Git Tags Locally and on Github


So I accidentally push some unnecessary tags on my repo by mistakenly updating the remote origin. Gladly, this repo does not implement any tagging and thus I can safely remove it all. But the question is how? Luckily there is a nice post about this.

Deleting all tags locally

git tag -d `git tag | grep -E '.'`

Deleting all tags in a remote repo

git ls-remote --tags origin | awk '/^(.*)(s+)(.*[a-zA-Z0-9])$/ {print ":" $2}' | xargs git push origin

As the article said,

Some pretty horrendous and scary looking regex’d git codings but it worked perfectly.


  • Git
  • Tips And Tricks