本文介绍了Git仓库中的Git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个主git存储库A,我们正在使用另一个git存储库B中的源代码在我们的主项目的子目录中。现在,在这个使用的子目录中的A存储库中检出B库。
如果有人然后克隆存储库当然他应该得到我们的主存储库A,并自动在B存储库中。
让我可视化目录结构:
+ main_repository - 主存储库的根目录
+ src - 包含源$ b $的目录b + foreignRepo - 这应该是另一个git repo的根目录
+二进制
+其他
这必须在远程存储库中也是已知的,只是本地副本不能帮助我,因为其他人检查出来,必须能够编译所有的东西。
解决方案
您将要阅读有关。
I have a main git repository A and we are using sources out of another git repository B in a subdirectory of our main project.Now it would be good to have the B repository checked out within the A repository in this used subdirectory.If someone else then clones the repository of course he should get our main repository A and within that automatically the B repository.
Let me visualize the directory structure:
+ main_repository - the root directory of the main Repository + src - directory containing the source + foreignRepo - this should be the root directory of another git repo + binaries + other
This must be also known in the remote repository, just a local copy doesn't help me, because other people check this out and must be able to compile all the stuff.
解决方案
You'll want to read about Git submodules.
这篇关于Git仓库中的Git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!