Skip to content

Instantly share code, notes, and snippets.

@stefanSchinkel
Created July 15, 2015 07:27
Show Gist options
  • Save stefanSchinkel/8634f3411a446e63f88f to your computer and use it in GitHub Desktop.
Save stefanSchinkel/8634f3411a446e63f88f to your computer and use it in GitHub Desktop.
git fix author/email
# just as a mental note, so I don't have to google it (again)
#
git filter-branch --env-filter '
oldname="(old name)"
oldemail="(old email)"
newname="(new name)"
newemail="(new email)"
[ "$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