Git Rewriting history with filter-branch Changing the author of commits


You can use an environment filter to change the author of commits. Just modify and export $GIT_AUTHOR_NAME in the script to change who authored the commit.

Create a file with contents like so:

if [ "$GIT_AUTHOR_NAME" = "Author to Change From" ]
    export GIT_AUTHOR_NAME="Author to Change To"
    export GIT_AUTHOR_EMAIL=""

Then run filter-branch from the command line:

chmod +x ./
git filter-branch --env-filter ./