Created
July 22, 2016 14:36
-
-
Save lucianomlima/83d36b6d634a9f40c7ff4536a65363b9 to your computer and use it in GitHub Desktop.
Script bash para renomear tags de um repositório Git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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