Changing author names across history
The snippet can be accessed without any authentication.
Authored by
Chris Woodall
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="email-address@barrett.com"
CORRECT_NAME="New Name"
CORRECT_EMAIL="new-email@barrett.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
# Once this is done you will need to do the following (and remove protected branches
# git push --force --tags origin 'refs/heads/*'
Please register or sign in to comment