Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created April 1, 2011 20:29
Show Gist options
  • Save matthewmccullough/898798 to your computer and use it in GitHub Desktop.
Save matthewmccullough/898798 to your computer and use it in GitHub Desktop.
Script to delete all tags both locally and remotely
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
@narzero
Copy link

narzero commented Nov 5, 2017

@jmrobison, thanks, worked!

@numediaweb
Copy link

For the issue with --delete doesn't make sense without any refs here's how I delete all the tags for 1.3.* :
git ls-remote --tags origin | awk '/^(.*)(1\.3\.\d+)$/ {print ":" $2}' | xargs git push origin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment