How to combine two branches from two different repositories in a single repository?

前端 未结 3 1768
失恋的感觉
失恋的感觉 2020-11-27 11:44

The structures of my Git repositories look like this:

A-B-C-D-E-F   # master branch in separate repo1
A-B-C-D-E-G-H # master branch in separate repo2
         


        
3条回答
  •  不知归路
    2020-11-27 12:12

    I think Jim is right. Also bear in mind that if two commits do exactly the same patch/diff against the code, they will have exactly the same SHA1 hash. So A through E should have the same SHA1 in both repos, so it shouldn't be a problem to merge from one to the other, and keep the merged repo as the sole repo to move forward with.

    You can setup on repo1 a tracking branch for repo2, and then keep them distinct that way, and delay the merge to whenever you want.

提交回复
热议问题