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.2k 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
- 17,353
- 13
- 86
- 137
0
In "Branches to build" you have to:
put the branch name or
*/${GIT_BRANCH}uncheck "Lightweight checkout" checkbox, which is below "Script Path"
blackgreen
- 18,419
- 19
- 55
- 71
Rosen Tsankov
- 66
- 2