每次我结帐我的回购/分支都会缺少新的git子模块
每当我克隆仓库(< my_repo>
)本地时,新的子模型目录(在< my_repo>/_/_ include/_ include/_ new_submodule_2>
)中是空的。
我已经在< new_submodule_2>/。gitmodules
喜欢这样的添加中:
[submodule "_includes/<submodule_1>"]
path = _includes/submodule_1
url = https://github.com/<my_org>/submodule_1
branch = master
[submodule "_includes/<NEW_submodule_2>"]
path = _includes/<NEW_submodule_2>
url = https://github.com/<my_org>/<NEW_submodule_2>
branch = master
我必须始终运行以下以下目录才能使该目录填充:git subpodule update -int -init--init--init -remote _includes _includes/&lt ; new_submodule_2&gt;
如何修复此操作,以便每次git克隆(或任何其他人克隆时)不必运行此命令?
Whenever I clone my repo (<my_repo>
) locally, the new submodule's directory (under <my_repo>/_includes/<NEW_submodule_2>
) is empty.
I have added in my <NEW_submodule_2>/.gitmodules
like so:
[submodule "_includes/<submodule_1>"]
path = _includes/submodule_1
url = https://github.com/<my_org>/submodule_1
branch = master
[submodule "_includes/<NEW_submodule_2>"]
path = _includes/<NEW_submodule_2>
url = https://github.com/<my_org>/<NEW_submodule_2>
branch = master
I have to always run the following to get that directory populated: git submodule update --init --remote _includes/<NEW_submodule_2>
How do I fix this so that this command doesn't have to be run everytime I git clone (or whenever someone else clones)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用一个命令: git克隆 - recurse-submodules ,
但是在常规克隆之后,submodule1和2均应为空。
You could use one command:
git clone --recurse-submodules
But both submodule1 and 2 should be empty after a regular clone.