Skip to content

Instantly share code, notes, and snippets.

@Souler
Last active June 18, 2017 09:37
Show Gist options
  • Save Souler/c2d0f71e76cef4c23698076aa898794c to your computer and use it in GitHub Desktop.
Save Souler/c2d0f71e76cef4c23698076aa898794c to your computer and use it in GitHub Desktop.
Bulk rename Git Tags
#!/bin/sh
for tag in `git tag`; do
newTag="v$tag"
echo "$tag -> $newTag"
git tag $newTag $tag # Create the new tag where the older pointed
git tag -d "$tag" # Delete the old tag
git push origin ":refs/tags/$tag" # Delete the old tag from the remote
done
git push --tags # Push all the new tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment