How to do it...

Now, we want to change the author of all the commits from origin/stable-3.2 to our HEAD, which is master. This is just an example; you will rarely have to change the author of commits that have already been published to a remote repository.

You can change the author of the HEAD commit by using git commit --amend --reset-author; however, this will only change the author of HEAD and leave the rest of the commits as they were. We will start by changing the author of the HEAD commit and then verify why that is wrong by performing the following steps:

  1. Change the author of the HEAD commit as follows:
$ git commit --amend --reset-author
[resetAuthorRebase b0b2836] Update Kepler target platform to use Kepler SR2 orbit R-build
  

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.