Skip to content

Instantly share code, notes, and snippets.

@mig82
Created June 2, 2017 13:28
Show Gist options
  • Save mig82/c7134c3c90c6a3f2577d7177a3fb1bfe to your computer and use it in GitHub Desktop.
Save mig82/c7134c3c90c6a3f2577d7177a3fb1bfe to your computer and use it in GitHub Desktop.
Clone a git repo into a specific subdir.
checkout([
$class: 'GitSCM',
branches: [
[name: '*/branchname']
],
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'MyDirectory'
]
],
submoduleCfg: [],
userRemoteConfigs: [
[
credentialsId: 'myId',
url: 'https://github.com/jenkinsci/jenkins.git'
]
]
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment