首页 > 代码库 > 2个仓库合并到一个仓库 并附带历史记录

2个仓库合并到一个仓库 并附带历史记录

 

down vote
+150

If you want to merge project-a into project-b:

cd path/to/project-b
git remote add project-a path/to/project-a举个例子 https://gitlab.sdtdev.net/dcs/client/web-client
git fetch project-a
git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge
git remote remove project-a

2个仓库合并到一个仓库 并附带历史记录