Jenkins Git插件和Refspecs [英] Jenkins Git plugin and Refspecs

查看:1642
本文介绍了Jenkins Git插件和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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆