Skip to content

Instantly share code, notes, and snippets.

@Ed1123
Last active May 2, 2022 22:39
Show Gist options
  • Save Ed1123/87a77f9a876e183700520f84f0df34db to your computer and use it in GitHub Desktop.
Save Ed1123/87a77f9a876e183700520f84f0df34db to your computer and use it in GitHub Desktop.
Update email in git history (just for personal projects)
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "wrong_email@wrong_host.local" ];
then
GIT_AUTHOR_NAME="Your Name Here";
GIT_AUTHOR_EMAIL="correct_email@correct_host.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