Tarun Prakash
Tarun Prakash

Reputation: 103

How do I achieve git Additional Behaviors => Checkout to specific local branch in Jenkins pipeline?

How do we achieve Git Additional Behavior in Jenkins pipeline?

Additional Behaviors
=> checkout to specific local branch

Upvotes: 5

Views: 8380

Answers (2)

fzh
fzh

Reputation: 688

you can find the pipeline syntax in your Jenkins job slide bar Pipeline Syntax section.

enter image description here

1、Sample Step select checkout: Check out from version control

2、click Additional Behaviours Add button

3、select checkout to specific local branch

4、click bottom Generate Pipeline Script button,you will get pipeline script.

Upvotes: 1

Mor Lajb
Mor Lajb

Reputation: 2636

check this one http://your-Jenkins:8080/pipeline-syntax/ , you can have samples of all your installed plugins.

checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'your-sub-directory']], gitTool: 'Default', submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'd767bb7a-4c1e-4654-a310-996d4ece5b02', url: '[email protected]:yyy/xxx.git']]])

enter image description here

Upvotes: 5

Related Questions