Ahh, I didn't realise I could specify the reference repo in the Jenkinsfile - I was looking for it in the multibranch job's configuration.
So rather than "checkout scm" in the Jenkinsfile I want something like this - ? checkout([$class: 'GitSCM', branches: [[name: '*']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 0, noTags: false, reference: '/foo', shallow: false]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '...', url: '....']]]) Is there any way of re-using the existing 'scm' object there? I'm not familiar with Java or Groovy, was hoping to do something along the lines of: scm.extensions.push([$class: 'CloneOption', reference: '/foo']) checkout scm but I'm struggling to get that working. On Sunday, 5 June 2016 13:55:49 UTC+1, Mark Waite wrote: > > The git plugin supports a reference repository from its "Advanced clone > options". A reference repository reduces the clone time and the disk space > for the history portion of a repository clone by creating pointers into a > bare repository on the same computer. > > The git plugin supports shallow clone from its "Advanced clone options". > A shallow clone reduces the clone time and disk space for the history > portion of a repository clone by only cloning a certain number of commits > rather than the entire history. With git versions after 1.9, I believe it > can still push new commits from a shallow clone. > > The git plugin allows sparse checkouts from the "Sparse checkout" > additional behaviour. Sparse checkouts reduce disc space for the working > directory portion of the clone by using a subset of the working directory > to be checked out instead of the full working directory. > > Each of those options can be assigned in a Jenkinsfile. The pipeline > snippet generator knows how to create those options when you choose git in > the snippet generator. > > I still haven't found the "best" way to handle those additional git plugin > options when dealing with merges between long-lived git branches. When I > assign those types of options, I seem to also be required to assign a > branch to be built, though I don't want that git "branch to be built" to > merge between long-lived branches. > > Mark Waite > > On Sun, Jun 5, 2016 at 6:10 AM Jonathan del Strother <jdelst...@gmail.com > <javascript:>> wrote: > >> Is there any way to get the multibranch plugin to share its git >> checkouts? It's fetching a fresh clone from github for every single >> branch, which seems excessive when I have 30 branches and a 500MB repo. >> I'm struggling to get it working because the initial checkouts keep getting >> killed due to the 10 minute timeout. >> I wondered if there was an option to either have a single .git repo >> shared amongst the workspaces (perhaps with git-worktree), or a local repo >> that can be cloned from, to avoid the repeated transfer from github.com. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to jenkinsci-use...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/23e7bf3e-513d-4720-ac70-506bae1f8b22%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/23e7bf3e-513d-4720-ac70-506bae1f8b22%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/54894249-e010-4f0f-b52b-e3186022a78a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.