I want to change the author of one specific commit in the history. It\'s not the last commit.
I know about this question - How do I change the author of a commit in
Commit before:
To fix author for all commits you can apply command from @Amber's answer:
git commit --amend --author="Author Name "
Or to reuse your name and email you can just write:
git commit --amend --author=Eugen
Commit after the command:
For example to change all starting from 4025621
:
You must run:
git rebase --onto 4025621 --exec "git commit --amend --author=Eugen" 4025621
Note: To include an author containing spaces such as a name and email address, the author must be surrounded by escaped quotes. For example:
git rebase --onto 4025621 --exec "git commit --amend --author=\"Foo Bar \"" 4025621
or add this alias into ~/.gitconfig
:
[alias]
reauthor = !bash -c 'git rebase --onto $1 --exec \"git commit --amend --author=$2\" $1' --
And then run:
git reauthor 4025621 Eugen