Jenkins Git plugin and Refspecs

What is the difference between Refspec and Branch specifier (blank for default): in the below Jenkins job configuration:

enter image description here

  • git branch continually getting recreated on pull
  • git alternatives to “svn info” that can be included in a build for traceability?
  • GIT how to create patch from non consecutive commits
  • Custom builds of jQueryUI
  • Deploying Schnitzelpress on Heroku - Error
  • Can I have “git stash” to automatically include untracked files by default?
  • I have tried to set the Refspec option in the job configuration:


    In the cloned repo on my build slave the .git/config file looks like this:

            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "origin"]
            url =
            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.

  • A system for creating multilingual static websites
  • Git corrupted with a commit
  • making a git push from a detached head
  • Gulp - Get return value of one task from another
  • Creating new file with touch command in PowerShell error message
  • Undoing a branch merge
  • One Solution collect form web for “Jenkins Git plugin and Refspecs”

    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

    Git Baby is a git and github fan, let's start git clone.