Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change Git commit author / email in existing commits

Docs: and

git filter-repo \
  --email-callback ' return email if email != b"OLD_EMAIL" else b"NEW_EMAIL" ' \
  --name-callback 'return name.replace(b"OLD_AUTHOR", b"NEW_AUTHOR")' \
  --force \
  --refs HEAD~<NUMBER_OF_COMMITS>..<BRANCH_NAME> # This line is optional, remove to do the change in all commits (will rewrite complete history)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment