Skip to content

Instantly share code, notes, and snippets.

@ernado
Created August 15, 2018 17:59
Show Gist options
  • Save ernado/d812c151f6c0a2491b9bd72754108b3f to your computer and use it in GitHub Desktop.
Save ernado/d812c151f6c0a2491b9bd72754108b3f to your computer and use it in GitHub Desktop.
Remove multiple git tags from remote
#!/bin/bash
# This will remove tags starting from "v0.15.1-"
git tag | grep '^v0.15.1-' > tags-to-remove.txt
cat tags-to-remove.txt | xargs git tag -d
cat tags-to-remove.txt | xargs -I% git push origin :refs/tags/%
rm tags-to-remove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment