I have a Jenkins Pipeline that I would like to have a user input on to checkout a specific branch of their choosing. i.e. If I create a branch 'dev' and commit it in git,but Jenkins take a default branch(master)
Can any one please help me take a code from 'dev' branch code
Thanks much in advance.
stage('Git Checkout') {
steps {
checkout(
[$class: 'GitSCM',
branches: [[name: '*/dev']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId:'987654322234245676543',
url:'http://repo.xyz.com/user/devop.git']]]
)
}
}
You can try pipeline step: git