Skip to content

Instantly share code, notes, and snippets.

@trentrand
Last active June 13, 2019 02:58
Show Gist options
  • Save trentrand/11ea0ee03ec04dfd4b22cfef36121bd1 to your computer and use it in GitHub Desktop.
Save trentrand/11ea0ee03ec04dfd4b22cfef36121bd1 to your computer and use it in GitHub Desktop.
Remove a range of git tags from remote by pushing an 'empty' reference to the remote tag name
#!/bin/bash
for i in $(seq $VERSION_MIN $VERISON_MAX); do
git push origin :refs/tags/"0.$i.0";
done
@trentrand
Copy link
Author

Replace $VERSION_MIN and $VERSION_MAX with your desired version range.

Make sure to format the version tag correct; for example, some may format versions as 1.0.0 instead of v1.0.0 .

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