简体   繁体   English

如何使用 Jenkins 管道签出特定的标签/提交(git)

[英]how to checkout specific tag/commit (git) with Jenkins pipeline

till now I ran the follwoing command in jenkins:到目前为止,我在 jenkins 中运行了以下命令:

git branch: branch_nam, url: url, credentialsId: cred

and it works fine.它工作正常。 I've tried to add a way to checkout specific tag/commit so I've used the follwing command:我试图添加一种方法来检查特定的标签/提交,所以我使用了以下命令:

checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: url]], branches: [[name: tag]]], credentialsId: cred, poll: false

but I get the following error:但我收到以下错误:

ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git fetch --tags --progress http://codefront:8080/tfs/DefaultCollection/some_folder +refs/heads/ :refs/remotes/origin/ " returned status code 128: stdout: stderr: fatal: Authentication failed for http://codefront:8080/tfs/DefaultCollection/some_folder错误:克隆远程 repo 'origin' hudson.plugins.git.GitException 时出错:命令“git fetch --tags --progress http://codefront:8080/tfs/DefaultCollection/some_folder +refs/heads/ :refs/remotes/ origin/ " 返回状态码 128: stdout: stderr: fatal: http://codefront:8080/tfs/DefaultCollection/some_folder身份验证失败

what did I do wrong?我做错了什么? what is the difference between they way each command works?他们每个命令的工作方式有什么区别?

Thanks in advance提前致谢

refer to the doc here : https://jenkins.io/doc/pipeline/steps/workflow-scm-step/请参阅此处的文档: https ://jenkins.io/doc/pipeline/steps/workflow-scm-step/

jenkins 用户远程配置参数手册

check if your url respect it.检查您的网址是否尊重它。 Please give me the value if it isn't the problem.如果不是问题,请给我价值。

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

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