How to reset author of earlier commit?

前端 未结 2 1382
抹茶落季
抹茶落季 2021-01-27 09:00

My local commits have wrong email so I used the following command to reset it. However, it only reset the latest local commit. How to reset the earlier ones?

git          


        
2条回答
  •  一整个雨季
    2021-01-27 09:23

    Do (you may need to increase/decrease 20 according to how far back the commit you want to edit is):

    git rebase -i HEAD~20
    

    and, for the commit you want to amend, replace pick with edit (in the interactive window). Save, and close.

    Then, do git commit --amend, make your change, and let the rebase continue.

提交回复
热议问题