Skip to content

Instantly share code, notes, and snippets.

@sh-sabbir
Created August 14, 2022 11:20
Show Gist options
  • Save sh-sabbir/8ac84c1caa95c3435dae8a60b127d546 to your computer and use it in GitHub Desktop.
Save sh-sabbir/8ac84c1caa95c3435dae8a60b127d546 to your computer and use it in GitHub Desktop.
git config alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if [[ \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ]]; then export \$VAR='\$NEW'; fi\" \$@; }; f "
git change-commits GIT_AUTHOR_NAME "<Old Name>" "<New Name>" -f
git change-commits GIT_AUTHOR_EMAIL <old@email.com> <new@email.com> -f
git change-commits GIT_COMMITTER_NAME "<Old Name>" "<New Name>" -f
git change-commits GIT_COMMITTER_EMAIL <old@email.com> <new@email.com> -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment