Skip to content

Instantly share code, notes, and snippets.

@rdeavila
Last active February 16, 2021 18:39
Show Gist options
  • Save rdeavila/7100671 to your computer and use it in GitHub Desktop.
Save rdeavila/7100671 to your computer and use it in GitHub Desktop.
Git: Renomeando uma tagFonte: http://stackoverflow.com/a/16251698/2788008
#!/bin/bash
# Primeiro cria um alias da tag antiga com um nome novo
git tag nome_novo nome_antigo^{}
#
# Remove a tag antiga localmente
git tag -d nome_antigo
#
# Depois, remove a tag no repositório remoto:
# Checkout da fonte remota
git remote -v
# O terceiro argumento é o seu repositório remoto,
# aquele que você acessa com `git remote`. Neste exemplo: `origin`
git push origin :refs/tags/nome_antigo
#
# Finalmente, adicona a nova tag ao repositório remoto. Enquanto você não fizer isso,
# a nova tag não vai ser adicionada:
git push origin --tags
#
# Repita este passo em todos os seus repositórios remotos.
@joseeverton
Copy link

receio que é seja o contrário "git tag nome_novo nome_antigo"

@rdeavila
Copy link
Author

@joseeverton Corrigido. Obrigado!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment