Azure 管道错误:路径规范“refs/remotes/origin/master”与 git 已知的任何文件都不匹配

问题描述

我正在尝试从 Azure Pipeline 作业中的 AWS Codecommit 签出代码。但是,动态构建代理抱怨它找不到主分支。

我仅限于使用经典编辑器,因为 AWS Codecommit 属于通用 git 存储库。我无法修改 git checkout 阶段,在那里我可以获取远程分支的整个列表。

From https://git-codecommit.ap-south-1.amazonaws.com/v1/repos/inxxxxxx
 * [new branch]      master       -> origin/master
##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.
##[debug]Exited process 4361 with exit code 0
##[debug]Finished process 4361 with exit code 0,and elapsed time 00:00:05.5947164.
##[debug]Processed: ##vso[telemetry.publish area=AzurePipelinesAgent;feature=GitFetch]{"elapsedtimeMilliseconds":"5597","RefSpec":"","RemoteName":"origin","FetchDepth":"0","ExitCode":"0","Options":"--force --tags --prune --progress --no-recurse-submodules origin "}
##[debug]Processed: ##vso[task.setprogress value=80]Starting checkout...
##[debug]refFetchedByCommit : 
##[debug]Checkout refs/remotes/origin/master.
git checkout --progress --force refs/remotes/origin/master
##[debug]Starting process:
##[debug]  File name: '/usr/bin/git'
##[debug]  Arguments: 'checkout --progress --force refs/remotes/origin/master'
##[debug]  Working directory: '/home/vsts/work/1/s'
##[debug]  Require exit code zero: 'False'
##[debug]  Encoding web name:  ; code page: ''
##[debug]  Force kill process on cancellation: 'False'
##[debug]  Redirected STDIN: 'False'
##[debug]  Persist current code page: 'False'
##[debug]  Keep redirected STDIN open: 'False'
##[debug]  High priority process: 'False'
##[debug]Updated oom_score_adj to 500 for PID: 4381.
##[debug]Process started with process id 4381,waiting for process exit.
error: pathspec 'refs/remotes/origin/master' did not match any file(s) kNown to git
##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.
##[debug]Exited process 4381 with exit code 1
##[debug]Finished process 4381 with exit code 1,and elapsed time 00:00:00.0069196.
##[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)

enter image description here

如何解决 Azure Pipeline 中的此签出错误?如何获取包括主分支在内的所有分支?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)