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
Steps to rename author name after commit pushed
git rebase i HEAD~10 (10 is the total commit to display on rebase)
If you Get anything like below
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please rm -fr
".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
Then type "git rebase --continue" or "git rebase --abort" as per your need
pick 897fe9e simplify code a little
pick abb60f9 add new feature
pick dc18f70 bugfix
Now you need to add below command just below of the commit you want to edit, like below
pick 897fe9e simplify code a little
exec git commit --amend --author 'Author Name
That's it, now just press ESC, :wq and you are all set
Then git push origin HEAD:BRANCH NAME -f [please take care of -f Force push]
like git push -f
or git push origin HEAD: dev -f