GIT – Change author or committer

If you want to change author’s and/or committer’s name and/or email in given GIT revisions, you can use the following script:

git filter-branch -f --commit-filter '
  if [ "$GIT_AUTHOR_NAME" = "Old Author" ];
  then
    export GIT_AUTHOR_NAME    = "New Author";
    export GIT_AUTHOR_EMAIL   = "[email protected]";
    export GIT_COMMITTER_NAME  = "New Author";
    export GIT_COMMITTER_EMAIL = "[email protected]";
  fi;
  git commit-tree "$@"'

Now update the remote (bare) repository

git push --force --tags origin 'refs/heads/*'