title: How can I get multiple Jenkins builds to work from one local git repo?
body: <p>I have a GitHub repo that's big and contains several independently build-able bits. If I configure Jenkins with a job (or two) for each of these, I end up with having to pull gigabytes of data multiple times (one clone of the repo for each job).</p>
  
  <p>This takes both diskspace and bandwidth.</p>
  
  <p>What I'd like to do is have "Refresh local repo" job that clones github once, then configure each of the jobs to clone themselves from that repo, and build. Then by setting up the sub-jobs as dependent builds, I can run "Refresh local repo", have it pull all the latest stuff from GitHub, then have each of the builds run.</p>
  
  <p>So far I've got the "Refresh local repo" working - it clones successfully, and if I go to the workspace, I see that it has the HEAD commit of origin/master.</p>
  
  <p>The problem is the other jobs - these don't seem to be picking up updates. Here's how I've got one of them configured:</p>
  
  <pre><code>Git
   Repository URL file:////Users/malcolmbox/.jenkins/jobs/Refresh Local repo/workspace
   Branches to build  master
  </code></pre>
  
  <p>Instead of this updating to the latest commit, it's stuck several days in the past.</p>
  
  <p>How can I get it to pull the tip and do the right thing?</p>
  
  <p>To clarify: the .../Refresh Local repo/workspace has commit 6b20268389064590147d5c73d2b6aceb6ba5fe70 submitted 28/3</p>
  
  <p>The dependent build, after running a build (so presumably doing a git clone/pull step) is checked out to 79a25992cc192376522bcb634ee0f7eb3033fc7e submitted 26/3 - so it's a couple of days behind.</p>