我正在一个 git 存储库 (A) 中处理一个项目,该项目包含另一个 git 存储库 (B),而后者又包含第三个 git 存储库 (C)。在 A 中,我通过以下方式添加了 B:
git submodule add https://github.com/blt04/sfDoctrine2Plugin.git plugins/sfDoctrine2Plugin
Click here ,您可以看到 B 引用 C 的位置:https://github.com/doctrine/doctrine2
添加 git 子模块后,我的 plugins/sfDoctrine2Plugin/lib/vendor/doctrine
文件夹(应该包含 C)是空的。我尝试根据 this StackOverflow answer 执行 git submodule update --recursive
,但它仍然没有将文件导入该路径。我不知道在这里做什么。
最佳答案
您需要执行 git submodule update --init --recursive
。这里的问题是子模块 C 从一开始就没有被初始化。
关于git - 添加包含另一个子模块的 git 子模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4600835/