【发布时间】:2018-06-07 10:31:33
【问题描述】:
到目前为止,我在 jenkins 中运行了以下命令:
git branch: branch_nam, url: url, credentialsId: cred
而且效果很好。 我试图添加一种方法来检查特定的标签/提交,所以我使用了以下命令:
checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: url]], branches: [[name: tag]]], credentialsId: cred, poll: false
但我收到以下错误:
错误:克隆远程 repo 'origin' 时出错 hudson.plugins.git.GitException:命令“git fetch --tags --progress http://codefront:8080/tfs/DefaultCollection/some_folder +refs/heads/:refs/remotes/origin/" 返回状态码 128:标准输出:标准错误:致命:身份验证失败 http://codefront:8080/tfs/DefaultCollection/some_folder
我做错了什么? 每个命令的工作方式有什么区别?
提前致谢
【问题讨论】:
-
似乎问题出在我给的标签上。当我使用提交 ID 时,它工作正常。我给了标签:ref/tags/mytag
-
checkout scm 是一种更通用的方式(您可以比使用其他源代码控制系统,取决于您选择的 $class)。我确实使用了 git,然后转到了结帐 scm。这实际上取决于您使用的作业类型(管道、多分支管道、Github 组织等)。
标签: git tags jenkins-pipeline git-checkout