Created
April 13, 2016 17:11
-
-
Save lifuzu/145fb2251bf867bd789085df9746c3cc to your computer and use it in GitHub Desktop.
Update email and user name in the git history
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 -f --commit-filter ' | |
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" -o "$GIT_AUTHOR_EMAIL" = "[email protected]" ]; | |
then | |
GIT_AUTHOR_NAME="User Name"; | |
GIT_AUTHOR_EMAIL="[email protected]"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi' HEAD | |
# Reference: | |
# http://git-scm.com/book/en/Git-Tools-Rewriting-History |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git commit --amend --no-edit --author="User Name <[email protected]>"
http://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit
If only the latest one.