How do you merge two Git repositories?

后端 未结 23 3294
耶瑟儿~
耶瑟儿~ 2020-11-21 05:45

Consider the following scenario:

I have developed a small experimental project A in its own Git repo. It has now matured, and I\'d like A to be part of larger projec

23条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-21 05:55

    Similar to @Smar but uses file system paths, set in PRIMARY and SECONDARY:

    PRIMARY=~/Code/project1
    SECONDARY=~/Code/project2
    cd $PRIMARY
    git remote add test $SECONDARY && git fetch test
    git merge test/master
    

    Then you manually merge.

    (adapted from post by Anar Manafov)

提交回复
热议问题