git-rerere
is the exact solution to a problem I have ... except that the merges that need to be "learnt" have already been performed and are non-trivial to repeat.
How can I "teach" rerere
about those commits with the minimum manual intervention.
Supposing that existing, but conflicting, branches A
and B
were merged together to form commit C
with resolved conflicts.
Then I was hoping to do:
git checkout A
git merge B
git reset --soft C
git merge --continue
rerere
sees the updated files as the appropriate resolution, and "learns" this resolution.But the reset
step doesn't work :(
--soft
reset isn't permitted during a merge.--mixed
reset nukes MERGE_HEAD
(and I assume generally screws around with the git state, such that the merge cannot be resumed)EDIT:
Manually "resetting" the files, by checking out C
before hand and copying over the relevant files works but is quite slow and tedious due to the large and complex nature of the repositor.
(lots of projects in separate folders, each with their own node_modules/packages folders that will tank the copy time, unless I target specific folders :( )
I'm hoping for something automated. #optimism
The contrib script rerere-train.sh
is for this exact purpose