0

I am trying to use

<branches>
    <hudson.plugins.git.BranchSpec>
        <name>refs/heads/master</name>
    </hudson.plugins.git.BranchSpec>
</branches>

in my config.xml

Which means I am intending to build only commits of master, but apparently jenkins seems to build from commits to any other branches too. I am not sure what I am doing wrong to accomplish this. Any help is appreciated.

PS: Using the jenkins Git plugin

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
Pramod Setlur
  • 811
  • 1
  • 15
  • 27
  • Can you check the 'Branches to build' subsection - this should tell you specifically what it is cloning, and you can change the branch name here if you wish. – PCM Apr 21 '16 at 21:19
  • I have seen the tags like this: `origin/master` – PCM Apr 21 '16 at 21:21

1 Answers1

0

You only need the branch name without the refs

<branches>
    <hudson.plugins.git.BranchSpec>
        <name>origin/master</name>
    </hudson.plugins.git.BranchSpec>
</branches>

Or for local branch:

<branches>
    <hudson.plugins.git.BranchSpec>
        <name>master</name>
    </hudson.plugins.git.BranchSpec>
</branches>
CodeWizard
  • 128,036
  • 21
  • 144
  • 167