git commit --amend --author "New Author Name <email@address.com>"
Using Interactive Rebase (For multiple commits)
git rebase -i -p <some HEAD before all of your bad commits>
Then mark all of your bad commits as "edit" in the rebase file. If you also want to change your first commit, you have to manually add it as first line in the rebase file (follow the format of the other lines). Then, when git asks you to amend each commit, do
git commit --amend --author "New Author Name <email@address.com>"
edit or just close the editor that opens, and then do
git rebase --continue
to continue the rebase.
You could skip opening the editor altogether here by appending --no-edit so that the command will be:
git commit --amend --author "New Author Name <email@address.com>" --no-edit && \
Comments