我已经创建了包含内容的 .gitmodules
文件
[submodule "xxxx/src/main/webapp/js/app/ui"]
path = xxx/src/main/webapp/js/app/ui
url = <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="02656b7642656b766a77602c616d6f" rel="noreferrer noopener nofollow">[email protected]</a>:xxx/task-core.git
但是如何使其内容出现在src/main/webapp/js/app/ui
中呢?
我做到了
git submodule init
git submodule update
但我的文件夹仍然是空的。
最佳答案
不要手动添加对 .gitmodules
的子模块引用,而是使用 git submodule add
。清理您的 .gitmodules 文件,然后尝试以下操作:
git submodule add <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c7b75685c7b756874697e327f7371" rel="noreferrer noopener nofollow">[email protected]</a>:xxx/task-core.git -- xxx/src/main/webapp/js/app/ui
然后您应该会看到编辑后的 .gitmodules
以及 git status
中列出的子模块目录。
现在是运行的好时机:
git submodule init
git submodule update
如需进一步引用,请查看this chapter of git-scm .
关于git - 将子模块添加到 git 项目并下载其内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29388029/