.gitmodules 中的 Git 子模块未初始化 [英] Git submodules in .gitmodules not initialized

查看:50
本文介绍了.gitmodules 中的 Git 子模块未初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://github.com/Uni-/shBrushesCollection

我创建了一个 GitHub 存储库并直接从 GitHub 的 Web 源编辑器制作了一个 .gitmodules 文件.当我克隆 repo 时,我注意到 .gitmodules 中的子模块没有被初始化.

I created a GitHub repository and made a .gitmodules file directly from GitHub's web source editor. When I then cloned the repo, I noticed the submodules in .gitmodules were not being initialized.

我想我尝试了几乎所有可能的命令,包括 update、init、update --init 等等.有没有办法使用当前的 .gitmodules 文件,而不是添加子模块?

I think I tried almost all commands possible, including update, init, update --init and so on. Is there a way to use current .gitmodules file, not submodules add?

推荐答案

编写子模块是不够的.

你应该使用 git submodule add:这将更新您的.gitmodules 文件在索引中创建一个特殊条目(您希望加载该子模块的位置).

You should rather use git submodule add: that will update your .gitmodules file and create a special entry in the index (where you want that submodule to be loaded).

然后,当您将其推送到 GitHub 上的上游存储库时,项目页面会将这些特殊条目显示为绿色文件夹.

Then, when you push that to your upstream repo on GitHub, the project page will display those special entries as a green folder.

这篇关于.gitmodules 中的 Git 子模块未初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆