title: How to make Jenkins poll git upstream?
body: <p>I have two Git repos: A (public) and B (private), where B is a fork of A, and B needs to be synchronized with A regularly. I have also added repo A to be a remote upstream of repo B like this:</p>
  
  <pre><code>cd &lt;local_folder_of_repo_B&gt;
  git remote add upstream &lt;URL_of_repo_A&gt;
  </code></pre>
  
  <p>I know that I can merge changes from A into B manually like this:</p>
  
  <pre><code>cd &lt;local_folder_of_repo_B&gt;
  git fetch upstream
  git merge upstream/master
  git push origin master
  </code></pre>
  
  <p>I have created a Jenkins job that triggers when there are commits in repo B. However, I need this job to also trigger when there are commits in repo A, too. Then merge those changes into repo B and build.</p>
  
  <p>EDIT:
  I have tried using the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Multiple+SCMs+Plugin" rel="nofollow">Jenkins Multiple SCMs plugin</a>. I added the two Git repositories and provided different local folders for them, as it is explained in the plugin page. Now the Jenkins job correctly polls both repos and triggers itself, but I am trying to avoid the need to keep two separate repos on my hard disk, because they are too large and I'm planning to scale this approach.</p>