I have a folder inside D:/TestFolder/ Now I need to git pull inside TestFolder using Jenkins every time I trigger a job. How is it possible?
Can anyone guide me on Jenkins git pull in a particular folder?
git plugins for Jenkins come with that option -
If you are using Jenkins freestyle job,
If you are using Jenkins scripted pipeline , It will be like
node() {
stage('checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'sub_folder']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'credentialId', url: 'http://repourl.net/x.git']]])
}
}