Skip to content

Instantly share code, notes, and snippets.

@samsour
Last active September 20, 2021 15:22
Show Gist options
  • Save samsour/9a8d4e22e178c5fd5b5048cb6245ec37 to your computer and use it in GitHub Desktop.
Save samsour/9a8d4e22e178c5fd5b5048cb6245ec37 to your computer and use it in GitHub Desktop.
Rewrite Commit History (Author & Committer)
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "<Old Name>" ];
then
GIT_COMMITTER_NAME="<New Name>";
GIT_AUTHOR_NAME="<New Name>";
GIT_COMMITTER_EMAIL="<New Email>";
GIT_AUTHOR_EMAIL="<New Email>";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment