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
If the commit that you want to change is not the last commit, then follow the below steps. If your commit is in different branch then first switch to that branch.
git checkout branch_name
Find commit before the commit that you want to change and find its hash. Then issue rebase command.
git rebase -i -p hash of commit
Then an editor will open and enter 'edit' for the commits that you want to change. Leave others with default 'pick' option. Once changed enter 'esc' key and wq! to exit.
Then issue git commit command with amendment option.
git commit --amend --author="Username email" --no-edit
Then issue the following command.
git rebase --continue
Once commit author is updated in the local repository, push the changes to the remote repository.