Thanks Mark. Since I'm using declarative pipeline in a Jenkinsfile in a 
multi-branch job, UI option is kinda scarce and less relevant for me. So 
anything that can be added to the declarative way of doing things is great. 
The example you linked to is in scripted pipeline form, which I'm trying to 
get away from where ever I can.

That said, I'm not versed enough in Git to understand these concepts 
mentioned... "checkout to specific local branch" doesn't mean much to me... 
I understand "checkout" but "_to_ a specific branch"? Not sure what it 
means.

What I understand is that the "checkout scm" command does a headless 
checking out of a given branch of a repository, which takes place thanks to 
a github webhook with "pull request" and "push", pointing to the Jenkins 
instance. So basically what I want, and hopefully is what you and Stephen 
are referring to soon be available, is that the "checkout scm" command will 
be such that won't be headless?

I'd be great if I could specify for it "--depth 1" and be able to do git 
operations on the checked out repo/branch. :)

On Saturday, June 17, 2017 at 3:13:45 PM UTC+3, Mark Waite wrote:
>
> .You're correct that the git push needs to be wrapped in some form of 
> credentials.
>
> Git checkouts in Jenkins can be done to the branch name of your choice, 
> including "match the branch name".  Refer to the "Additional Behaviour" 
> called "Checkout to specific local branch".  The online help for that 
> option says that you can use "**" as the value and that will be interpreted 
> to use the branch name which was selected for checkout.  An example is 
> available in 
> https://github.com/MarkEWaite/jenkins-bugs/blob/JENKINS-33827/Jenkinsfile .  
> The "pipeline syntax" for checkout will add that behavior for you as well 
> (though as Stephen notes, the UI is not pretty and shows you many things as 
> options which you should not use).
>
> Sorry that is not the default, but preserving historical behavior has been 
> important for the many users of the plugin.
>
> Mark Waite
>
> On Sat, Jun 17, 2017 at 1:09 AM Idan Adar <id...@adar.me <javascript:>> 
> wrote:
>
>> I take it back, not good workaround for me after all...
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/954f8f8f-9cc3-4085-ba95-d3a241dc8e8a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/954f8f8f-9cc3-4085-ba95-d3a241dc8e8a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e0519bdd-a0cb-4162-a8aa-2a1aed17af55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to