如何将 Gitlab 中的子模块添加到我的本地存储库中

问题描述 投票:0回答:0

我是初学者,几个小时以来我一直在努力解决这个问题。

如果有一个子模块出现在我的 Gitlab 仓库中,我想将它添加到我的本地仓库中。执行此操作的命令应该是什么?

比如我的Gitlab repo URL在下面,

trees
文件夹是一个新的子模块,没有出现在我的本地repo上:

https://gitlab.com/my_components/trees.git

解决方案是拉取或克隆那个特定的子模块以便它们同步吗?

在命令行下方。我进入特定路径并使用以下命令(?):

\docs\my_components> git clone https://gitlab.com/my_components/trees.git

或超越一级:

\docs>git submodule update https://gitlab.com/my_components.git 

虽然这最后一个会更新整个父文件夹,但我不是在寻找它,因为它需要几个小时(它有数千个组件)。

我只需要同步一个特定的子模块,而不是整个父文件夹。

git gitlab git-submodules
© www.soinside.com 2019 - 2024. All rights reserved.