Skip to content

Instantly share code, notes, and snippets.

@lewkoo
Created July 10, 2020 07:09
Show Gist options
  • Save lewkoo/c11ad0e06aa9838a442afd20760c113f to your computer and use it in GitHub Desktop.
Save lewkoo/c11ad0e06aa9838a442afd20760c113f to your computer and use it in GitHub Desktop.
Batch rename all tags inside a Git repo
git tag -l | while read old_t; do
new_t="${old_t//v/}"
new_t="${new_t//-alpha/}"
echo $new_t
git tag $new_t $old_t
git push --tags
git tag -d $old_t
git push origin :refs/tags/$old_t
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment