无法从 VSTS Build Process 任务发出 git pull 命令

Unable to issue a git pull command from a VSTS Build Process task

构建代理上存在批处理文件 (c:\myBatchFile.bat)。当批处理文件为 运行 时,它成功地执行了以下操作:

cd c:\myrepo
git pull

但是,当我在 VSTS 构建作业中将 powershell 任务告诉 运行 c:\myBatchFile.bat 时,出现以下错误:

error: failed to execute prompt script (exit code 255)
fatal: could not read Username for 'https://whatever.visualstudio.com': No error

注意:c:\myrepo 是 VSTS 作业使用的构建源代码库的旁白。

同样,直接告诉 VSTS 构建作业 powershell 任务发出两个命令 (cd c:\myrepo & git pull),这会导致 git pull 处出现相同的错误阶段。

Git 在生成代理计算机本身上,已通过 VSTS 进行身份验证。似乎当第三方(构建作业)尝试 运行 代理上的命令(通过在代理上创建 powershell 脚本并执行 powershell 脚本的方式)时,命令失败。

有什么想法吗?

谢谢

主要思想是检查哪个用户是运行 powershell 任务(当它由 VSTS 构建作业触发时)

因为如果它在一种情况下工作而不在另一种情况下工作,变化是,对于 HTTPS URL,git credential helper 在一种情况下有所帮助。

在两个实例中执行 git config credential.helper