Created
November 5, 2017 10:08
-
-
Save fujimaki-k/ec413160555c75130cdf20c65c200889 to your computer and use it in GitHub Desktop.
Change git author and commiter
This file contains 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
EMAIL="OLD@EMAIL" | |
GIT_NAME="NEW NAME" | |
GIT_EMAIL="NEW@EMAIL" | |
git filter-branch --commit-filter ' | |
if [ "$GIT_AUTHOR_EMAIL" = "$EMAIL" ]; | |
then | |
GIT_AUTHOR_NAME="$GIT_NAME"; | |
GIT_AUTHOR_EMAIL="$GIT_EMAIL"; | |
GIT_COMMITER_NAME="$GIT_NAME"; | |
GIT_COMMITER_EMAIL="$GIT_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