title: What's the difference between `git config` and `git push --set-upstream`
body: <h2>Question</h2>
  
  <p>What's the difference between:</p>
  
  <pre><code>$ git remote add origin git@github.com:yourname/yourproject.git
  $ git config remote.origin.push refs/heads/master:refs/heads/master
  $ git push
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>$ git remote add origin git@github.com:yourname/yourproject.git
  $ git push origin master -u
  </code></pre>
  
  <p>Is the second version simply newer and shorter than the first version, or are there other differences?</p>
  
  <h2>Background Research</h2>
  
  <p>As of Git 1.7.0, you can use the <code>--set-upstream</code> option with <code>git push</code>. According to the <code>git push</code> manual:</p>
  
  <blockquote>
  <pre><code>-u, --set-upstream
      For every branch that is up to date or successfully pushed, add upstream
      (tracking) reference, used by argument-less git-pull(1) and other commands. For
      more information, see branch.&lt;name&gt;.merge in git-config(1).
  </code></pre>
  </blockquote>