How to change the commit author for one specific commit?

后端 未结 19 1856
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 05:15

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

相关标签:
19条回答
  • 2020-11-22 06:00

    If what you need to change is the AUTHOR OF THE LAST commit and no other is using your repository, you may undo your last commit with:

    git push -f origin last_commit_hash:branch_name 
    

    change the author name of your commit with:

    git commit --amend --author "type new author here"
    

    Exit the editor that opens and push again your code:

    git push
    
    0 讨论(0)
提交回复
热议问题