每次我结帐我的回购/分支都会缺少新的git子模块

发布于 2025-01-29 01:03:48 字数 757 浏览 2 评论 0原文

每当我克隆仓库(< 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久隐师 2025-02-05 01:03:48

您可以使用一个命令: git克隆 - recurse-submodules

git clone --recurse-submodules=_includes/<NEW_submodule_2>

但是在常规克隆之后,submodule1和2均应为空。

You could use one command: git clone --recurse-submodules

git clone --recurse-submodules=_includes/<NEW_submodule_2>

But both submodule1 and 2 should be empty after a regular clone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文