Skip to content

Instantly share code, notes, and snippets.

@codeaid
Last active February 12, 2016 19:20
Show Gist options
  • Save codeaid/03ec04e9ce1d63fa9f34 to your computer and use it in GitHub Desktop.
Save codeaid/03ec04e9ce1d63fa9f34 to your computer and use it in GitHub Desktop.
Update git commit names and emails
git filter-branch --env-filter 'if [ $GIT_AUTHOR_EMAIL = [email protected] ]; then GIT_COMMITTER_NAME="New Name"; [email protected]; GIT_AUTHOR_NAME="New Name"; [email protected]; fi; export GIT_COMMITTER_NAME; export GIT_COMMITTER_EMAIL; export GIT_AUTHOR_NAME; export GIT_AUTHOR_EMAIL;' -f
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; then export GIT_AUTHOR_NAME="New Email"; export [email protected]; export GIT_COMMITTER_NAME="New Name"; export [email protected]; fi; git commit-tree "$@"'
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "Old Name" ]; then export GIT_AUTHOR_NAME="New Name"; export GIT_COMMITTER_NAME="New Name"; fi; git commit-tree "$@"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment