如何合并两个仓库
git
2016-05-05

repo:
    repo1
    repo2

steps:

cd repo1
git remote add other ../.repo2
git fetch other
#git checkout -b repo2 other/master
git checkout repo2 other/master
git checkout master
git merge repo2

解释:

  1. 以repo1为主,合并repo2
  2. 把repo2添加为repo1的远程仓库,并命名为other
  3. fetch repo2 的内容
  4. 在repo1中创建repo2的分支。
  5. 切换到repo1的master分支。
  6. 合并repo2分支的代码到master。
其它文章