This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to delete all but a specified list of tags | |
# from a git repo, both locally and remotely | |
# Run like `mode=test ruby git_tag_cleanup` to test; | |
# use 'execute' mode to actually delete the tags | |
mode = ENV['mode'] || 'test' | |
tags_to_keep = %w[v2.0.0 v2.0.1] | |
tags_to_delete = `git tag`.split("\n") - tags_to_keep |