title: Github: Import upstream branch into fork
body: <p>I have a fork (<code>origin</code>) from a project (<code>upstream</code>) on github. Now the upstream project has added a new branch, I want to import into my fork. How do I do that?</p>
  
  <p>I tried checking out the remote and creating a branch on top of that, but that configures the branch the way that <code>git push</code> is trying to push to the <code>upstream</code>:</p>
  
  <pre><code>git checkout upstream/branch
  git checkout -b branch
  </code></pre>
  
  <h3>edit</h3>
  
  <p>Maybe that wasn't clear, but I want to add the branch to my local repository, so I can push it to <code>origin</code> (my fork) via <code>git push</code>. Because upstream repositories are usually read-only and you fork it to contribute.</p>
  
  <p>So I basically want to checkout a non-existent branch on <code>origin</code> whose contents will be pulled in from <code>upstream</code>.</p>