How do we achieve Git Additional Behavior in Jenkins pipeline?
Additional Behaviors
=> checkout to specific local branch
How do we achieve Git Additional Behavior in Jenkins pipeline?
Additional Behaviors
=> checkout to specific local branch
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: 'git@github.com:yyy/xxx.git']]])
you can find the pipeline syntax in your Jenkins job slide bar Pipeline Syntax section.
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.