Skip to content

Instantly share code, notes, and snippets.

@euhmeuh
Created May 29, 2018 10:45
Show Gist options
  • Save euhmeuh/0ffc347f80f52b681609f310e519bf0e to your computer and use it in GitHub Desktop.
Save euhmeuh/0ffc347f80f52b681609f310e519bf0e to your computer and use it in GitHub Desktop.
Rewrite emails in a git history
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "old.mail@example.com" ];
then
GIT_AUTHOR_NAME="username";
GIT_AUTHOR_EMAIL="new.mail@example.com";
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