Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使一个git存储库中的文件夹依赖于另一个?_Git_Github_Dependencies - Fatal编程技术网

如何使一个git存储库中的文件夹依赖于另一个?

如何使一个git存储库中的文件夹依赖于另一个?,git,github,dependencies,Git,Github,Dependencies,我有两个git存储库。这是我的文件夹结构 ~/test/ << This is one project .git FolderA/ FolderB/ ~/pim/ << This is another project .git Foo/ Foo/Bar/ 下面是我想做的伪代码: -在测试中,分支主控上的Bar目录映射到pim项目中分支名称release1的Foo/Bar目录 当pim项目中发生提交时,我希望测试中的相应

我有两个git存储库。这是我的文件夹结构

~/test/    << This is one project
   .git
   FolderA/
   FolderB/

~/pim/     << This is another project
   .git
   Foo/
   Foo/Bar/
下面是我想做的伪代码: -在测试中,分支主控上的Bar目录映射到pim项目中分支名称release1的Foo/Bar目录

当pim项目中发生提交时,我希望测试中的相应文件夹自动更新。其想法是将pim作为提交所有代码的主副本

我看了看,但他们似乎对我的案子没有帮助

是否可以在不将整个pim回购复制到测试中的情况下实现这一点?我有什么选择


非常感谢您的帮助。

使用像jenkins或travis ci这样的集成服务器,您可以在每次构建主repo时克隆受抚养人的最新版本,并在每次受抚养人更改时触发受抚养人的构建。 还有一些GitHook可能会引起一些兴趣

~/test/
   .git
   FolderA/
   FolderB/
   Bar     <<< This maps to the "Foo/Bar" folder in the pim project on branch 

~/pim/
   .git
   Foo/
   Foo/Bar/