Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detached HEAD w/Jenkins Git Plugin and Branch Specifier

Jenkins v2.19

Git Plugin v2.5.3

Under Branches to Build I am specifying 2 branches:

*/develop

and

*/master

This results in a HEAD detached at {git commit hash}. I have different actions in my gradle build scripts that use the current git branch as a trigger to take different actions.

How can I make this checkout develop to develop and master to master rather than a detached HEAD?

like image 681
Bill Mote Avatar asked Sep 02 '16 17:09

Bill Mote


1 Answers

Set the following:

Additional Behaviours > Check out to specific local branch

Click on "?" to see details about this option.

like image 56
Marcelo Ávila de Oliveira Avatar answered Sep 29 '22 06:09

Marcelo Ávila de Oliveira