Last Updated: February 25, 2016
· robinvdvleuten

Ruby script for bulk deleting both local and remote Git tags

A very simple Ruby script for bulk deleting your Git tags both local and remote. Create a file called git-deletealltags.bsh and put in the following;

for t in `git tag`
  git push bitbucket :$t
  git tag -d $t

Now run this script inside the root of your Git repository and all tags will be deleted.

1 Response
Add your response

A better cli local-only alternative is
git tag -l | awk '/^(.*)$/ {print $1}' | xargs git tag -d

over 1 year ago ·