I am using Branch Specifier option of Jenkins Git plugin (v2.0) to run build on specific branch, e.g. 1.4
.
${GIT_BRANCH}
in this case conta
As of March 2016 (Git Plugin v2.4.3) this is now supported natively. Simply put **
as the value for Check out to specific local branch
in the Git Plugin, instead of any macro/variable.
The description for the field details the new behavior:
If selected, and its value is an empty string or "**", then the branch name is computed from the remote branch without the origin. In that case, a remote branch origin/master will be checked out to a local branch named master, and a remote branch origin/develop/new-feature will be checked out to a local branch named develop/newfeature.
This was introduced by @roostergx & @NickVolynkin mentioned when it was released. I'm just documenting here to hopefully help folks in the future.