Mar 9, 2018
Change Git Commit Authors
Here's a quick script to rewrite the git author/commiter in a repo. I mess this up all the time if I'm on a work computed making changes to a personal project (e.g. this website), and I want my commit history to use my personal email address, rather than the globally configured work email.
git filter-branch -f --env-filter '
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
' --tag-name-filter cat -- --branches --tags
Note that since this changes git history, if anyone else has a fork of this project, they are going to have a bad time. Use responsibly!