Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Renames multiple tags using regexp. Usage: git_rename_tags.sh $frompattern $topattern
#!/bin/sh
shopt -s extglob
for tag in $(git tag -l)
do
newtag=`echo "$tag" | sed -E "s/$1/$2/"`
if [[ $tag != $newtag ]]; then
git tag $newtag $tag
git tag -d $tag
git push origin :refs/tags/$tag
git push --tags
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.