I had the situation where a git repository had the wrong author name and email. Before this was going to be published I wanted all commits having the correct author name.
After short research I found this solution:
git filter-branch --commit-filter ' if [ "$GIT_COMMITTER_NAME" = "<Old Name>" ]; then GIT_COMMITTER_NAME="<New Name>"; GIT_AUTHOR_NAME="<New Name>"; GIT_COMMITTER_EMAIL="<New Email>"; GIT_AUTHOR_EMAIL="<New Email>"; git commit-tree "$@"; else git commit-tree "$@"; fi' HEAD
I put this into a .sh file, replaced the placeholders with my parameters and executed it.