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
解释:
- 以repo1为主,合并repo2
- 把repo2添加为repo1的远程仓库,并命名为other
- fetch repo2 的内容
- 在repo1中创建repo2的分支。
- 切换到repo1的master分支。
- 合并repo2分支的代码到master。