Skip to content

Instantly share code, notes, and snippets.

@ajbonner
Last active August 7, 2017 19:43
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 ajbonner/a6ceea45b7e6cd89ea05c13002a9c4d9 to your computer and use it in GitHub Desktop.
Save ajbonner/a6ceea45b7e6cd89ea05c13002a9c4d9 to your computer and use it in GitHub Desktop.
Rename old git tags and copy annotations
#!/bin/bash
for tag in $(git tag | grep '^2017'); do
git tag -a $(echo $tag | sed 's/^2017/17/') $tag -m "$(git tag -n $tag | sed -E 's/2017\.[0-9]{2}\.[0-9]{2}\.[0-9]{2}\s*//')"
git tag -d $tag
git push origin :refs/tags/$tag
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment