Changing the author of commits

suggest change

You can use an environment filter to change the author of commits. Edit and export GIT_AUTHOR_NAME in the script to change who authored each commit. This rewrites those commits; do not use it on history other people have already fetched unless you intend to force-push. The committer name stays the person who runs the filter unless you also set GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL.

Create a file filter.sh with contents like so:

if [ "$GIT_AUTHOR_NAME" = "Author to Change From" ]
then
    export GIT_AUTHOR_NAME="Author to Change To"
    export GIT_AUTHOR_EMAIL="email.to.change.to@example.com"
fi

Then run filter-branch from the command line:

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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents