How do you merge two Git repositories?

后端 未结 23 3255
耶瑟儿~
耶瑟儿~ 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 06:05

    Merging 2 repos

    git clone ssh:// project1
    cd project1
    git remote add -f project2 project2
    git merge --allow-unrelated-histories project2/master
    git remote rm project2
    
    delete the ref to avoid errors
    git update-ref -d refs/remotes/project2/master
    

提交回复
热议问题