Jenkins Git插件和Refspecs [英] Jenkins Git plugin and Refspecs
问题描述
在下面的Jenkins作业配置中, Refspec 和分支说明符(默认为空白)之间有什么区别:
I试图在作业配置中设置Refspec选项:
+ refs / heads / master:refs / remotes / origin / master
在我的build slave的克隆回购中,.git / config文件如下所示:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remoteorigin]
url = https:// user:pass@git.internal.com/scm/PROJECT/project.git
fetch = + refs / heads / *:refs / remotes / origin / *
[branch'master']
remote = origin
merge = refs / heads / master
看来这个值为fo r 获取不正确(从jenkins作业配置中读取)。
Refspec 定义了抓取操作(请参阅此处和此处),而分支说明符定义哪个分支包含代码由Jenkins构建。换句话说: Refspec 仅定义代码如何在分支说明符的哪个部分被编译时检索。
修复了无效链接到refspec
What is the difference between Refspec and Branch specifier (blank for default): in the below Jenkins job configuration:
I have tried to set the Refspec option in the job configuration:
+refs/heads/master:refs/remotes/origin/master
In the cloned repo on my build slave the .git/config file looks like this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://user:pass@git.internal.com/scm/PROJECT/project.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
It seems that the value for fetch is not correct (read from the jenkins job configuration). Further it has no effect on the diskspace consumption.
Refspec defines options for the fetch operation (see here and here) whereas the branch specifier defines which branch contains the code to be built by Jenkins. In other words: Refspec only defines how the code is retrieved while branch specifier which part of the code is going to be compiled.
[Edit:] Fixed broken link to refspec
这篇关于Jenkins Git插件和Refspecs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!