1

I have two repositories A.git and B.git. They are completely separate (do not share any common ancestor).

Now I can merge changes from a branch in A.git to a branch in B.git by adding A.git as a remote on B.git. E.g. from B.git:

git add remote a_remote [URL to B.git]
git fetch a_remote
git merge a_remote/[branch from A.git]

As a result I will not get two separate roots in B.git.

I just tried to do this on two different repositories of a fairly large size (the two repositories have some files in common) and got tons of conflicts.

If putting aside the best practices discussion here what is actually causing all these conflicts?

And what consequences does it have when a repository have two unrelated roots?

u123
  • 12,921
  • 42
  • 141
  • 247

1 Answers1

1

If the files that the two repositories have in common do not exactly match, that is where the conflicts are coming from. As far as git is concerned, these files were added independently to both branches, and there is no way for git to tell which is the right one to use.

David Deutsch
  • 13,210
  • 3
  • 41
  • 45