I have an existing repo for which I need to change all the author emails on all the commits (I'm the only one who works on that repo).
git rebase --root --exec 'git commit --amend --author="Arthur ATTOUT <[email protected]>" --no-edit'
While the first ~100 commits are treated properly, upon a specific commit, git freaks out and complains there is a conflict
error: could not apply 0709cb2... Unit32 default value watermark
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 0709cb2... Unit32 default value watermark
Auto-merging ViewModels/ViewModels/DataprepControl.cs
CONFLICT (content): Merge conflict in ViewModels/ViewModels/DataprepControl.cs
me@home MINGW64 ~/source/repos/soft (dev|REBASE-i 129/320)
Why does git suddenly realises there is a conflict in those super old commits ? Shouldn't rebase take into account conflicts resolution I have applied at that time ?
It's probably due to the fact that what you're trying to rebase is not a single, linear branch but something that contains several merge points (from annex branches that have been integrated into the main one).
When running the command you launched, Git will scavenge all commits he can find back to the root of you repository, then reapplying them one by one but will not preserve the structure. You'll then will loose all merge resolutions you had to do so far.
You probably want to take a look at git filter-branch
instead.
Also, if what you want to do is to reset all authors to the default one (you), consider using --reset--author
instead, which don't need to have an argument passed.