Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change author on git commit without re-fixing merge conflicts [duplicate]

I am working on a project with git version control. It has many contributors. In the first few days of the project, many commits were made without an author. I read this post, and this one too. I have tried going through git rebase -i <Original commit SHA> but all of the commits I flag with an edit tag have merge conflicts to address! I looked into calling rerere to use the old fixes, but because rerere changes are cached and I had not originally set it to true in gitconfig, it's not an option here.

Short of going commit-by-commit and readdressing the merge conflicts, what can I do to change the authors for those early commits?

like image 951
broguinn Avatar asked Dec 10 '25 17:12

broguinn


1 Answers

The posts your reference mention rebase -i, but also git filter-branch.

You should try the git filter_branch approach, which doesn't re-apply each commits, and doesn't have to resolve merge conflicts.

Like the rebase, that will change your history, though, and you will have to push --force the end result.

like image 199
VonC Avatar answered Dec 13 '25 05:12

VonC