Created
December 13, 2014 11:27
-
-
Save nlamirault/f9c21abf6607947e7678 to your computer and use it in GitHub Desktop.
git rename author commit
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 --env-filter ' | |
oldname="old username" | |
oldemail="old email address" | |
newname="new username" | |
newemail="old username address" | |
[ "$GIT_AUTHOR_EMAIL"="$oldemail" ] && GIT_AUTHOR_EMAIL="$newemail" | |
[ "$GIT_COMMITTER_EMAIL"="$oldemail" ] && GIT_COMMITTER_EMAIL="$newemail" | |
[ "$GIT_AUTHOR_NAME"="$oldname" ] && GIT_AUTHOR_NAME="$newname" | |
[ "$GIT_COMMITTER_NAME"="$oldname" ] && GIT_COMMITTER_NAME="$newname" | |
' HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment