Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git rerere and resolution covering non-conflicting files

Tags:

git

git-rerere

I experienced the following situation:

I ran into a conflict during a merge with git rerere enabled.

I fixed the conflicting file, but other non-conflicting files had to be adjusted, too.
All touched files were added and committed. git rerere stated that it has recorded the resolution.

A later git pull --rebase=preserve repeated the merge conflicts and git rerere came to the rescue.
However, only the part of the resolution in the conflicting files was applied, the changes in the other files were not.
A quick glance in the rr-cache indicates that those other changes have not been recorded.

Is git rerere only recording changes in the directly conflicting files and nothing else?

Is there an option to record all changes done in the resolving commit, not only the conflicting file?

like image 451
Bernhard Avatar asked Jan 30 '26 07:01

Bernhard


1 Answers

Is git rerere only recording changes in the directly conflicting files and nothing else?

Yes. Well, almost—it's slightly more complicated.

Is there an option to record all changes done in the resolving commit, not only the conflicting file?

No, and this is where the "slightly more complicated" part comes in. The rerere code doesn't record all the changes and resolutions; it only records the conflicting changes and their corresponding resolutions. The non-conflicting bits are not saved at all.

(Note, by the way, that git rebase --preserve actually re-creates the merges, i.e., does new git merge commands, as I think you've already observed. Invoking it from git pull has no effect on this part of the process.)

like image 110
torek Avatar answered Feb 01 '26 23:02

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!