How to change the author and committer name and e-mail of multiple commits in Git?

后端 未结 30 3126
野性不改
野性不改 2020-11-21 04:50

I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in my pendrive, cloned from my computer at home). After several c

30条回答
  •  逝去的感伤
    2020-11-21 05:16

    If you are using Eclipse with EGit, then there is a quite easy solution.
    Assumption: you have commits in a local branch 'local_master_user_x' which cannot be pushed to a remote branch 'master' because of the invalid user.

    1. Checkout the remote branch 'master'
    2. Select the projects/folders/files for which 'local_master_user_x' contains changes
    3. Right-click - Replace with - Branch - 'local_master_user_x'
    4. Commit these changes again, this time as the correct user and into the local branch 'master'
    5. Push to remote 'master'

提交回复
热议问题