简体   繁体   English

如何在TFS服务器的Linux代理中运行Shell脚本

[英]How to run shell script in linux agent of a TFS server

I not able to understand these below errors, can someone point out why am i getting these errors, when try run shell script which is in github error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git Git checkout failed with exit code: 1 . 我无法理解以下错误,有人可以指出为什么我尝试运行github error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git Git checkout failed with exit code: 1 shell脚本时会出现这些error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git Git checkout failed with exit code: 1

******************************************************************************
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
******************************************************************************

I think you are trying to clone an empty git repository. 我认为您正在尝试克隆一个空的git存储库。

I have the same error: 我有同样的错误: 在此处输入图片说明

Initialize your repository or select another 初始化您的存储库或选择另一个 在此处输入图片说明

and you`ll get your files. 您会得到文件。 在此处输入图片说明

是的,我终于弄清楚了,我必须在服务选项卡/部分的tfs中添加带有凭据的github存储库作为tfs的端点(我仍然想知道这是否绝对必要),而且我还必须在我的克隆该存储库。 linux machine agent,在shell-script path字段中提供该路径,然后在“ Arguments”字段中传递我的脚本特定参数,添加所有这些后,我的脚本已成功执行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM