Azure DevOps Git REST API是否支持添加子模块?

时间:2020-09-30 19:52:47

标签: azure-devops azure-devops-rest-api

我找不到与此相关的任何参考。

是否支持调用其REST API来添加子模块?

1 个答案:

答案 0 :(得分:0)

我找不到与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\1)
  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,然后在电源外壳中使用git cmd。您可以参考文档posh-gitSetting up Git in PowerShell

相关问题