Last active
August 20, 2020 18:21
-
-
Save ricardopedias/53effef69623875287946b9ecb6e222c to your computer and use it in GitHub Desktop.
Renomear os commits de um repositório git
This file contains 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
# ver as informações de autor e comitador | |
git log --pretty=fuller | |
# faz a substutuição | |
git filter-branch -f --commit-filter ' | |
if [ "$GIT_AUTHOR_EMAIL" = "contato@outroemail.com.br" ]; | |
then | |
GIT_AUTHOR_NAME="Ricardo Pereira"; | |
GIT_AUTHOR_EMAIL="contato@ricardopedias.com.br"; | |
GIT_COMMITTER_NAME="Ricardo Pereira"; | |
GIT_COMMITTER_EMAIL="contato@ricardopedias.com.br"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi | |
' HEAD; | |
# ver as informações de autor e comitador | |
git log --pretty=fuller | |
# sincroniza a nova estrutura de commits com o repo remoto | |
git push --force | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment