将一个git仓库作为分支导入另一个仓库仓库

将一个git仓库作为分支导入另一个仓库仓库

问题描述:

由于历史原因,我们在不同的git存储库中有不同版本的源代码。因此,虽然项目A持有源的版本X项目B持有源的版本Y.

For historic reason we have source code for different version in different git repositories. So while Project A holds the version X of the source Project B holds version Y of the source.

你们知道一种方法来导入项目B作为项目的一个分支A?

Do you guys know a way to import Project B as a branch of Project A?

谢谢

Thanks

您必须将项目B添加为远程,然后获取:

This is simple with Git. You have to add project B as remote, then fetch:

git remote add projectB git://url.to/projectB.git
git fetch projectB