How to Change the Author Name and Email for Multiple Git Commits
If you have made 100 git commits and want to change the autor name and email address of all of them, this blog post is for you.
git rebase HEAD git commit amend
Assuming you made several commits for a coworker or used a different name or email, and want to change the author information to XYZ <xyz@company.com>
for the last 100 commits, this command will help you change it for all of them.
git rebase -i HEAD~100 -x "git commit --amend --author 'XYZ <xyz@company.com>' --no-edit"
After that command is run, the author information for all 100 commits would have been changed to XYZ.
Verify the commit author details
Run this to verify the commit author information for the last 100 commits:
git log -100
You will be able to see the same git commit information, but with the author XYZ with their email address instead of the previous authors'.
Conclusion
If this has not worked for you, let me know via email or add a comment below. Thanks for reading.
Related Posts
If you have any questions, please contact me at arulbOsutkNiqlzziyties@gNqmaizl.bkcom. You can also post questions in our Facebook group. Thank you.