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
There is also a lazy approach to this problem, especially if you have more than one commit that you want to change. In my case, I had a new branch with several commits with a wrong author, so what helped me:
Go to your original branch:
git checkout develop
Create new branch from it:
git checkout -b myFeature develop
Merge it without commit info as one commit:
git merge --no-commit --squash branchWrongAuthor
You might also want to stage changes:
git stage .
Change the name of the author and commit changes:
git commit --amend --author "New Author Name " -m "new feature added"
And that's it, you can push the changes.
git push
You can delete the branch with a wrong author after that.