How can I use the Jenkins Git plugin to check out a specific branch? I have installed Jenkins and I use the GIT plugin to clone a repository. Any help would be greatly appreciated.
Asked
Active
Viewed 1.5k times
5
-
Possible duplicate of [Checkout remote Git branch](http://stackoverflow.com/questions/1783405/checkout-remote-git-branch) – Don Scott Jan 09 '16 at 04:32
-
1Not really duplicate. OP wants how to use Jenkins Git plugin. The linked question is specifically on git. – Jayan Jan 09 '16 at 11:32
3 Answers
5
There is an option to pass branch name in Jenkins Git Plugin/ Git Parameter Plugin.
This accepts build parameters. So you could add parameter to the job, say with BRANCH_NAME and pass it to git plugin. Options are Just above the "Repository Browser" setting

Jayan
- 18,003
- 15
- 89
- 143
1
In "Branches to build" you have to:
put the branch name or
*/${GIT_BRANCH}
uncheck "Lightweight checkout" checkbox, which is below "Script Path"

blackgreen
- 34,072
- 23
- 111
- 129

Rosen Tsankov
- 86
- 2