Change the last commit's author

Git, Commit · May 3, 2022

Updates the last commit's author without changing its contents.

  • Use git commit --amend to edit the last commit.
  • Use the --author option to change the <name> and <email> of the commit's author.
git commit --amend --author="<name> <email>"
# Make some changes to files
git add .
git commit --amend --author="Duck Quackers <>"
# The last commit's author is now `Duck Quackers`

Written by Angelos Chalaris

I'm Angelos Chalaris, a JavaScript software engineer, based in Athens, Greece. The best snippets from my coding adventures are published here to help others learn to code.

If you want to keep in touch, follow me on GitHub or Twitter.

More like this