Skip to content

Instantly share code, notes, and snippets.

@rm3l
Created May 1, 2022 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rm3l/0ef83820ab8731fd67db97ab9118d752 to your computer and use it in GitHub Desktop.
Save rm3l/0ef83820ab8731fd67db97ab9118d752 to your computer and use it in GitHub Desktop.
git-filter-repo - changing author and committer email in multiple commits
#!/bin/sh
# Install git-filter-repo, as suggested by git docs: https://git-scm.com/docs/git-filter-branch#_warning
git filter-repo --commit-callback '
old_email = b"your-old-email@example.com"
correct_name = b"Your Correct Name"
correct_email = b"your-correct-email@example.com"
if commit.committer_email == old_email :
commit.committer_name = correct_name
commit.committer_email = correct_email
if commit.author_email == old_email :
commit.author_name = correct_name
commit.author_email = correct_email
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment