【问题标题】:How to run shell script in linux agent of a TFS server如何在 TFS 服务器的 linux 代理中运行 shell 脚本
【发布时间】:2019-07-11 01:21:33
【问题描述】:

我无法理解以下这些错误,有人可以指出为什么我会在尝试运行 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
******************************************************************************

【问题讨论】:

  • 我无法理解以下这些错误,有人可以指出为什么我会在尝试运行 github 中的 shell 脚本时遇到这些错误“错误:pathspec 'refs/remotes/origin/master'与 git 已知的任何文件都不匹配 Git checkout failed with exit code: 1"
  • 我已将您的评论添加到问题正文中,我想这对潜在的回答者来说会更清楚。
  • 请分享您的构建定义 - 获取源阶段。

标签: linux git tfs agent


【解决方案1】:

我认为您正在尝试克隆一个空的 git 存储库。

我有同样的错误:

初始化您的存储库或选择另一个

你会得到你的文件。

【讨论】:

  • 是的,我终于想通了,我必须在 tfs 中的服务选项卡/部分下添加我的 github 存储库和我的凭证作为端点(我仍然想知道这是否绝对必要),而且我必须在我的 linux 机器代理中克隆该 repo,在 shell-script 路径字段中提供该路径,然后在“参数”字段中传递我的脚本特定参数,添加所有这些后,我的脚本成功执行
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 2020-01-03
    • 1970-01-01
    • 2020-10-12
    • 2019-12-03
    • 2016-10-06
    • 1970-01-01
    • 1970-01-01
    • 2016-12-01
    • 2014-11-20
    相关资源
    最近更新 更多