I have made a series of commits in Git and I realise now that I forgot to set my user name and user email properties correctly (new machine). I have not yet pushed these co
To change the author only for the last commit:
git commit --amend --author 'Author Name ' --no-edit
Suppose you only want to change the author for the last N commits:
git rebase -i HEAD~4 -x "git commit --amend --author 'Author Name ' --no-edit"
NOTES
--no-edit
flag makes sure the git commit --amend
doesn't ask an extra confirmationgit rebase -i
, you can manually select the commits where to change the author, the file you edit will look like this:
pick 897fe9e simplify code a little
pick abb60f9 add new feature
exec git commit --amend --author 'Author Name ' --no-edit
pick dc18f70 bugfix