Last active
May 2, 2022 22:39
-
-
Save Ed1123/87a77f9a876e183700520f84f0df34db to your computer and use it in GitHub Desktop.
Update email in git history (just for personal projects)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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