| 克隆 | git clone --recurse-submodules --depth 1 <url> |
|---|---|
| 已克隆仓库 | git submodule update --init --recursive --depth 1 |
| 权限 | 子模块与父仓库需同一套只读凭据(部署密钥/令牌) |
CI 常用写法
CI 常用写法
git clone --recurse-submodules --shallow-submodules --depth 1 https://example.com/app.git
git -C app submodule status --recursive子模块地址为 SSH 时,CI 需准备对应私钥(或改用 HTTPS + 令牌),先做一次连通性验证。