1

I am following the instructions here: https://stackoverflow.com/a/614254/400723 in order to combine 3 git repos into a single one. Unfortunately, while pulling in the 3rd, I am getting a significant number of conflicts. These repos should not have any overlap with the files that they touch, is there something I'm missing?

I created "proj-parent" and checked out the three repos into it: api, import, and commons. I did the filter-branch command and everything was fine. I pulled in commons first and then import (which had a few conflicts). I am trying to do a git pull on api now and there are a significant number of conflicts (most of them with import). Did I do something wrong? There should be virtually no overlap with the files that these projects touch as far as I'm aware.

Community
  • 1
  • 1
Derek
  • 1,196
  • 11
  • 32

1 Answers1

1

You're looking for the the -s recursive -Xours option for git merge.

This option does the following:

...This option forces conflicting hunks to be auto-resolved cleanly by favoring 'our' version. Changes from the other tree that do not conflict with our side are reflected to the merge result. For a binary file, the entire contents are taken from our side...

Anywhere there would be a conflict (both versions changing the same content), it will auto-select the HEADs version and continue to move on automatically. It auto merges everything else just as if it were a normal merge.

g19fanatic
  • 10,567
  • 6
  • 33
  • 63