Skip to content

Instantly share code, notes, and snippets.

@rm3l
Created May 1, 2022 22:53
Show Gist options
  • 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"[email protected]"
correct_name = b"Your Correct Name"
correct_email = b"[email protected]"
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