title: Jenkins pipelines: How to use them with Git, especially with multiple Git repos?
body: <p>The situation...</p>
  
  <p>I have several Git repos which are all needed for my build.  I'm actively developing code on one, whilst the others contain library code I use.  Since each repo is independent, of course they all have different branch names.</p>
  
  <p>For my Jenkins build, I would like to fetch the relevant versions of code from each repo, put them in the correct subdirectories, and build my project.  Ideally I should also be able to do a shallow clone (because one of these repos is large), and be able to do a sparse checkout of only the path I want.</p>
  
  <p>The <a href="https://wiki.jenkins.io/display/JENKINS/Multiple+SCMs+Plugin" rel="nofollow noreferrer">Multiple SCMs plugin</a> seemed to be the ideal tool for the job.  However it is not in active development, and I've seen it throwing asserts which other people have talked about.</p>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/40224272/using-a-jenkins-pipeline-to-checkout-multiple-git-repos-into-same-job">this question</a> which answers how to use the Jenkins Pipeline to do this, so I've investigated the Jenkins Pipeline.  I quickly found from the <a href="https://jenkins.io/doc/pipeline/steps/git/" rel="nofollow noreferrer">Git Pipeline documentation</a> that its support for Git could most charitably be described as "minimal", a statement which is equally true for the rest of the Pipeline concept.  (And that's before we get into the nightmare which is replacing a perfectly workable UI with a text-only interface.  Maintenance nightmare, much?   Ugh!)</p>
  
  <p>I could also set up Git subprojects.  I'd rather not have to go down this route as a way to solve the inadequacies of the latest version of Jenkins, but needs must if it's the only solution.</p>
  
  <p>I will say that a solution other than Jenkins isn't really an option, because we have been using Jenkins in our company for some time and we don't really want to have to set up something else.</p>