Azure DevOps Git REST API 是否支持添加子模块?
Does Azure DevOps Git REST API support adding submodules?
我找不到这方面的任何参考资料。
是否支持调用他们的 REST API 来添加子模块?
我找不到相关的 REST API 添加子模块。
如果您想从子模块下载文件,我们可以在管道的 Checkout 步骤中配置子模块设置。
示例代码:
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: boolean # whether to fetch clean each time
fetchDepth: number # the depth of commits to ask Git to fetch
lfs: boolean # whether to download Git-LFS files
submodules: true | recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
path: string # path to check out source code, relative to the agent's build directory (e.g. \_work)
persistCredentials: boolean # set to 'true' to leave the OAuth token in the Git config after the initial fetch
或者我们可以使用 git command git submodule add {url}
来检出子模块
更新1
我们可以安装 PowerShell 模块 posh-git,然后我们可以在电源 shell 中使用 git cmd。可以参考文档 posh-git and Setting up Git in PowerShell
我找不到这方面的任何参考资料。
是否支持调用他们的 REST API 来添加子模块?
我找不到相关的 REST API 添加子模块。
如果您想从子模块下载文件,我们可以在管道的 Checkout 步骤中配置子模块设置。 示例代码:
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: boolean # whether to fetch clean each time
fetchDepth: number # the depth of commits to ask Git to fetch
lfs: boolean # whether to download Git-LFS files
submodules: true | recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
path: string # path to check out source code, relative to the agent's build directory (e.g. \_work)
persistCredentials: boolean # set to 'true' to leave the OAuth token in the Git config after the initial fetch
或者我们可以使用 git command git submodule add {url}
来检出子模块
更新1
我们可以安装 PowerShell 模块 posh-git,然后我们可以在电源 shell 中使用 git cmd。可以参考文档 posh-git and Setting up Git in PowerShell