Git 签出失败,退出代码:Azure DevOps 中的 1

Git checkout failed with exit code: 1 in Azure DevOps

我在 Azure DevOps 存储库中有设置代码。我正在为管道使用自托管代理。我已经设置了一个管道来使用 Azure DevOps 存储库,但在结帐时,我遇到了以下错误。

我试过清理工作文件夹。另外,我在特定工作的配置文件中添加了"IgnoreCase=True"

##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.
##[debug]Finished process 14976 with exit code 1, and elapsed time 00:00:13.4575355.
##[error]Git checkout failed with exit code: 1
##[debug]Processed: ##vso[task.logissue type=error;]Git checkout failed with exit code: 1
##[debug]Processed: ##vso[task.complete result=Failed;]
##[debug]   at Agent.Plugins.Repository.GitSourceProvider.GetSourceAsync(AgentTaskPluginExecutionContext executionContext, RepositoryResource repository, CancellationToken cancellationToken)
   at Agent.Plugins.Repository.CheckoutTask.RunAsync(AgentTaskPluginExecutionContext executionContext, CancellationToken token)
   at Agent.PluginHost.Program.Main(String[] args)

我想使用自托管代理结帐 Azure DevOps 存储库。

at Agent.Plugins.Repository.GitSourceProvider.GetSourceAsync(AgentTaskPluginExecutionContext executionContext, RepositoryResource repository, CancellationToken cancellationToken)

根据这个错误信息,我查看了它对应的源函数代码:GetSourceAsync。然后从评论中我确认这个 repos 有子模块。所以这个问题是由于在构建之前没有启用Checkout Submodule可选的。

根据私下分享的结帐日志:

checkoutSubmodules的值为False,这就是为什么代理无法安装包含子模块的项目并抛出错误消息的原因。

要解决它,只需转到“获取源代码”页面,然后 启用 可选:检查子模块