Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
容器镜像库
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
8bd890b4
提交
8bd890b4
编辑于
3 weeks ago
作者:
Hannes Hörl
浏览文件
操作
下载
补丁
差异文件
Update docs for submodule update flags
上级
316158e4
No related branches found
分支 包含提交
No related tags found
标签 包含提交
2 合并请求
!3031
Merge per-main-jh to main-jh by luzhiyuan
,
!3030
Merge per-main-jh to main-jh
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
doc/ci/runners/configure_runners.md
+33
-5
33 个添加, 5 个删除
doc/ci/runners/configure_runners.md
有
33 个添加
和
5 个删除
doc/ci/runners/configure_runners.md
+
33
−
5
浏览文件 @
8bd890b4
...
...
@@ -739,8 +739,13 @@ subcommand. However, `GIT_SUBMODULE_UPDATE_FLAGS` flags are appended after a few
Git honors the last occurrence of a flag in the list of arguments, so manually
providing them in
`GIT_SUBMODULE_UPDATE_FLAGS`
overrides these default flags.
You can use this variable to fetch the latest remote
`HEAD`
instead of the tracked commit in the repository.
You can also use it to speed up the checkout by fetching submodules in multiple parallel jobs.
For example, you can use this variable to:
-
Fetch the latest remote
`HEAD`
instead of the tracked commit in the
repository (default) to automatically updated all submodules with the
`--remote`
flag.
-
Speed up the checkout by fetching submodules in multiple parallel jobs with
the
`--jobs 4`
flag.
```
yaml
variables
:
...
...
@@ -758,12 +763,35 @@ git submodule update --init --depth 50 --recursive --remote --jobs 4
{{
<
alert
type=
"warning"
>
}}
You should be aware of the implications for the security, stability, and reproducibility of
your builds when using the
`--remote`
flag. In most cases, it is better to explicitly track
submodule commits as designed, and update them using an auto-remediation/dependency bot.
You should be aware of the implications for the security, stability, and
reproducibility of your builds when using the
`--remote`
flag. In most cases,
it is better to explicitly track submodule commits as designed, and update them
using an auto-remediation/dependency bot.
The
`--remote`
flag is not required to check out submodules at their committed
revisions. Use this flag only when you want to automatically updated submodules
to their latest remote versions.
{{
<
/
alert
>
}}
The behavior of
`--remote`
depends on your Git version. Some Git versions might
fail, with the error below, when the branch in the superproject's
`.gitmodules`
differs from the default branch of the submodule repository:
`fatal: Unable to find refs/remotes/origin/<branch> revision in submodule path '<submodule-path>'`
The runner implements a "best effort" fallback that attempts to
pull remote refs when the submodule update fails.
If this fallback does not work with your Git version, try one of the following
workarounds:
-
Update the submodule repository's default branch to match the branch set in
`.gitmodules`
in the superproject.
-
Set
`GIT_SUBMODULE_DEPTH`
to
`0`
.
-
Update the submodules separately and remove the
`--remote`
flag from
`GIT_SUBMODULE_UPDATE_FLAGS`
.
### Rewrite submodule URLs to HTTPS
{{
<
history
>
}}
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录