【发布时间】:2014-03-25 21:26:56
【问题描述】:
我有两个 git 项目。一个依赖于另一个存储库的子文件夹。
以下是文件夹的设置方式。
repoA
.git
folderA1/
folderA2/
repoB
.git
folderB1/
folderB1/folderB11
folderB2/
我想要实现的是以下
repoA
.git
folderA1/
folderA2/
folderB11 <<<< This maps to the repoB on branch name "blah"
repoB
.git
folderB1/
folderB1/folderB11
folderB2/
在repoA 中,文件夹A1 中的某些文件可能会引用文件夹B11 中的文件。 repoA 包含引用 folderB11 中文件的 python 模块。同样,repoB 也包含引用 folderB11 中文件的 python 模块。
我查看了 git subtree,但它似乎没有同步两个文件夹。
一种选择是创建folderB11 作为存储库并将其添加到repoA 和repoB 的子树,但我宁愿没有第三个存储库,因为维护代码会很痛苦。此外,拥有第三个存储库不是理想的选择,因为 folderB11 应位于 repoB 以确保项目其余部分的准确性。
有没有办法将 git repo 的子文件夹与另一个 git repo 的子文件夹同步?
【问题讨论】:
标签: git repository