Skip to content

Instantly share code, notes, and snippets.

@bluefeet
Last active February 26, 2019 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bluefeet/0fe5f527f42b46e3f9175c1f125a7714 to your computer and use it in GitHub Desktop.
Save bluefeet/0fe5f527f42b46e3f9175c1f125a7714 to your computer and use it in GitHub Desktop.
git tag NEW OLD
git tag -d OLD
git push origin :refs/tags/OLD
git push origin refs/tags/NEW
# Other contributors should clear out the deleted tags from their
# clones or they may re-introduce them to origin by accident.
git pull --prune --tags
# One-liner to rename all tags when migrating from Dist::Zilla to
# Minilla. Works for the case where your existing tags are in "v0.01"
# format and Minilla wants to start doing "0.01".
git tag | perl -ne 'chomp; if ($_ =~ m{^v(\d+\.\d+)$}) { system($_) for ("git tag $1 v$1","git tag -d v$1","git push origin :refs/tags/v$1","git push origin refs/tags/$1") }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment