nortmas
9/5/2017 - 4:20 AM

Change author name in all git history

to change author name in all git history. https://help.github.com/articles/changing-author-info/

git filter-branch -f --env-filter '
OLD_NAME="Dmitry"
CORRECT_NAME="thomas lehmann"
CORRECT_EMAIL="thomas.lehmann@cyperfection.de"
if [ "$GIT_COMMITTER_NAME" = "$OLD_NAME" ]
then
    export GIT_COMMITTER_NAME="$CORRECT_NAME"
    export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_NAME" = "$OLD_NAME" ]
then
    export GIT_AUTHOR_NAME="$CORRECT_NAME"
    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
# last step is to Push the corrected history to GitHub:
git push --force --tags origin 'refs/heads/*'