通常我们使用 gerrit trigger plugin在 jenkins 中下载 gerrit 变更集。
但在某些情况下,我们希望直接下载特定的变更集。
git pull git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/32/503032/2
并在 git repo 中将 Refspec
设置为 refs/changes/32/503032/2
并在 Additional behavior like 中启用 Honor refspec on initial clone
但我在控制台日志中遇到错误
Fetching upstream changes from git://git.openstack.org/openstack/tripleo-quickstart-extras > git fetch --tags --progress git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/32/503032/2 --depth=1 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 > git rev-parse origin/master^{commit} # timeout=10 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
任何建议,我们不想在 shell 构建步骤中使用额外的命令。
最佳答案
将“Branch”设置为FETCH_HEAD
,指定的refspec将被 check out 。
FETCH_HEAD
是一个临时 ref,指向最新获取的 refspec,例如。分支,提交。有关更多信息,请参阅此问题:What does FETCH_HEAD in Git mean? .
关于git - 如何在 jenkins git 插件中下载一个特定的 gerrit 更改集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46203871/