Sytone's Ramblings

The occasional posts of a guy who plays with technology.

Changing the commit author

2020-10-14 1 min read Development

So, you made some commits and then realise you used the wrong author and email address. No problem, use the following command to update them all and then you can push with consistent happiness.

This assumes you are doing this in PowerShell, if in bash you may need to escape the quotes differently.

The GIT commit id is the one before the commits with the wrong author. For the Author use the format name <email@address.com>

Example:

git rebase --onto 6b4b751 --exec "git commit --amend --author='Fred Smith <fred@example.com>'" 6b4b751