How to change the commit author for past commits
-
Interactive rebase
git rebase -ip [commit hash]
-
In the rebase view, change
pick
toedit
(ore
) for the commits you want to change. -
Back on the command line when each commit is loaded during the rebase, amend the commit with:
git commit -v --amend --author="Jamis Charles <myemail@example.com>" --no-edit
-
Move to the next commit (until complete)
git rebase --continue
-
Done! If your remote branch has the wrong commit author you'll need to force push your changes (careful with that).