Maybe a git config
setting can help:
rerere.autoupdate
When set to true, git-rerere
updates the index with the resulting contents after it cleanly resolves conflicts using previously recorded resolution.
Defaults to false.
Note: since Git1.7.0,
"git rerere
" had rerere.autoupdate
configuration but there was no way to countermand it from the command line;
--no-rerere-autoupdate
option given to "merge
", "revert
", etc. fixes this.
Git 2.38 (Q3 2022) updates documentation on the "--[no-]rerere-autoupdate
" option.
See commit cb54fc9 (03 Aug 2022), and commit 0dbc715 (15 Jul 2022) by Junio C Hamano (gitster
).
(Merged by Junio C Hamano -- gitster
-- in commit 3adacc2, 14 Aug 2022)
doc
: clarify rerere-autoupdate
The "--[no-]rerere-autoupdate
" option controls what happens after the rerere mechanism kicks in to reuse recorded resolutions and does not prevent from the rerere mechanism to trigger in the first place.
It is unclear in the current text if "--no-rerere-autoupdate
" stops the auto-resolution.
Rewrite the sentence to clarify.
rerere-options
now includes in its man page:
After the rerere mechanism reuses a recorded resolution on
the current conflict to update the files in the working
tree, allow it to also update the index with the result of
resolution.
--no-rerere-autoupdate
is a good way to
double-check what rerere
did and catch potential
mismerges, before committing the result to the index with a
separate git add
.