Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Modifying Authors and Utilizing Git Rebase in Collaborative Workflows

Is it feasible to modify the authorship information, including name, email, and commit content, for a specified range of commits?

This scenario arises when multiple collaborators contribute to a shared repository. Additionally, what are the benefits of employing Git rebase, and in what circumstances should this technique be utilized?

I’d like to change the all author’s email on a repository history for a specific author’s in multiple contributors

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

First, if you haven’t already done so, you will likely want to fix your name in git-config:

git config --global user.name "New Author Name"
git config --global user.email "<email@address.example>"

This is optional, but it will also make sure to reset the committer name, too, assuming that’s what you need.

To rewrite metadata for a range of commits using a rebase, do

git rebase -r <some commit before all of your bad commits> \
    --exec 'git commit --amend --no-edit --reset-author'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading