如何在TFS服务器的linux代理中运行shell脚本

问题描述 投票:0回答:2

我无法理解以下这些错误,有人可以指出为什么我得到这些错误,当尝试运行在github error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git Git checkout failed with exit code: 1中的shell脚本时。

******************************************************************************
Starting: Build
******************************************************************************


Current agent version: '2.105.7'
******************************************************************************


Starting: Get Sources
******************************************************************************


Syncing repository: Job (TfsGit)


git version

git config --get remote.origin.url

git config gc.auto 0

git config --get-all

http.http://54.183.83.168:8080/tfs/DefaultCollection/_git/Job.extraheader

git config --get-all http.proxy

git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin

git checkout --progress --force refs/remotes/origin/master

error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git

Git checkout failed with exit code: 1


******************************************************************************
Finishing: Get Sources
*****************************************************************************

*

*****************************************************************************

*

Starting: Post Job Cleanup
******************************************************************************

Cleaning any cached credential from repository: Job (Git)

git remote set-url origin 

http://54.183.83.168:8080/tfs/DefaultCollection/_git/Job

git remote set-url --push origin 

http://54.183.83.168:8080/tfs/DefaultCollection/_git/Job
******************************************************************************
Finishing: Post Job Cleanup
******************************************************************************
******************************************************************************
Finishing: Build
******************************************************************************
linux git tfs agent tfs2017
2个回答
0
投票

我想你正在尝试克隆一个空的git存储库。

我有同样的错误:enter image description here

初始化您的存储库或选择另一个enter image description here

你会得到你的文件。 enter image description here


0
投票

是的,我终于弄清楚了,我必须在服务选项卡/部分的tfs中添加我的github repo和我的crendentials作为端点(我仍然想知道它是否绝对必要)而且我必须克隆我的回购linux机器代理,在shell-script路径字段中提供该路径,然后在“Arguments”字段中传递我的脚本特定参数,添加了所有这些,我的脚本成功执行

© www.soinside.com 2019 - 2024. All rights reserved.