Skip to content

Instantly share code, notes, and snippets.

@chadly
Last active August 29, 2015 14:02
Show Gist options
  • Save chadly/6183d380d461f368420e to your computer and use it in GitHub Desktop.
Save chadly/6183d380d461f368420e to your computer and use it in GitHub Desktop.
Deletes remote and local git tags that match the format v1.0.0+123
#!/bin/bash
#http://blog.siyelo.com/how-to-bulk-delete-remote-git-tags/
git ls-remote --tags origin | awk '/^(.*)(\s+)(.*\+[0-9]+)$/ {print ":" $2}' | xargs git push origin
git tag -l | awk '/^(.*\+[0-9]+)$/ {print $1}' | xargs git tag -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment