0

I have a Repo (called Repo1) and another separate Repo, which has branches in it (REpo2). What I am trying to do is fold changes made in the master branch of Repo2 into Repo1

Is there a way to merge across multiple Repos? or can I only merge between branches of the same Repo?

Lawrence Cooke
  • 1,567
  • 3
  • 26
  • 52
  • unfortunatly the accepted answer on that question requires a third party tool that states that it only works if no merges have been done. my repo has merges so would not work with that solution. – Lawrence Cooke Nov 09 '13 at 17:31

2 Answers2

2

You can export patches (git diff or git format-patch) and then apply them on the other repo (git apply or git am, or even the plain old "patch" program).

John Zwinck
  • 239,568
  • 38
  • 324
  • 436
  • This is the old-fashioned way of doing things, which is still sometimes valid, but may not be necessary. Github with its pull requests between repositories can be more convenient. – Robin Green Nov 09 '13 at 10:04
  • @RobinGreen: OK, but the OP didn't mention GitHub. I am also in shock that patch files are now considered by some to be "old fashioned!" – John Zwinck Nov 09 '13 at 10:41
  • No , while I use the Github app, I have my remote repos at bitbucket, if I can do it via bitbucket, that would be ok too :) – Lawrence Cooke Nov 09 '13 at 17:32
0

You could do a repo-merge, which is a bit complex, but if you google this keywords, you will get much better tutorials on this as I could write right now (I did it for two or three times by now and it always worked really good).

Another thing you could do is adding the second repo as remote. Then you are able to merge in the remote branches from this repo.

musicmatze
  • 4,124
  • 7
  • 33
  • 48