Skip to content

Instantly share code, notes, and snippets.

@lucianomlima
Created July 22, 2016 14:36
Show Gist options
  • Save lucianomlima/83d36b6d634a9f40c7ff4536a65363b9 to your computer and use it in GitHub Desktop.
Save lucianomlima/83d36b6d634a9f40c7ff4536a65363b9 to your computer and use it in GitHub Desktop.
Script bash para renomear tags de um repositório Git
#!/bin/bash
TAG_LIST=`git tag -l | grep VERSION_`
BRANCH=`git rev-parse --abbrev-ref HEAD`
for TAG in $TAG_LIST
do
NEW_TAG=$(echo $TAG | sed s/VERSION_/v/ | sed s/_/\./g)
echo Renomeando tag $TAG para $NEW_TAG
git tag $NEW_TAG $TAG
echo Excluindo tag $TAG
git tag -d $TAG
git push origin :refs/tags/$TAG
echo
done
echo Enviando novas tags para o repositório...
git push origin $BRANCH --tags
echo Concluído.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment