title: How can I track a reference with a branch in git?
body: <p>I want to track a Github pull request locally with git as the request is updated (example: more commits are added). Github has a way that you can work on pull requests that come to your repo by checking out the read only refs/pull/.</p>
  
  <p>In other words if someone submits a pull request to my repo I can retrieve that request locally:</p>
  
  <pre><code>git fetch upstream pull/123/head:123
  git checkout 123
  </code></pre>
  
  <p>The problem comes in when someone then updates that pull request. I can't figure out how to update the local branch because git pull doesn't work to update my local copy:</p>
  
  <pre><code>$ git pull
  There is no tracking information for the current branch.
  Please specify which branch you want to merge with.
  See git-pull(1) for details
  
      git pull &lt;remote&gt; &lt;branch&gt;
  
  If you wish to set tracking information for this branch you can do so with:
  
      git branch --set-upstream-to=&lt;remote&gt;/&lt;branch&gt; 123
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>git branch --set-upstream-to=upstream/refs/pull/123/head 123
  git branch --set-upstream-to=upstream/refs/pull/123 123
  git merge --ff-only refs/pull/123/head
  merge: refs/pull/123/head - not something we can merge
  </code></pre>