title: What is a git upstream
body: <p>When you have created a github-repo and added the the github-repo as remote </p>
  
  <pre><code>git remote add origin https://github.com/githubname/reponame.git
  </code></pre>
  
  <p>then you need to push your first commit with </p>
  
  <pre><code>git push -u origin master
  </code></pre>
  
  <p>I read (<a href="https://stackoverflow.com/questions/6089294/why-do-i-need-to-do-set-upstream-all-the-time">Why do I need to do `--set-upstream` all the time?</a>) that this a short form for doing</p>
  
  <pre><code>git branch --set-upstream-to my_branch origin/my_branch
  git push
  </code></pre>
  
  <p>What is a upstream exactly and why do I need to set it? There is little information about this on the net. I know that there is a similar topic <a href="https://stackoverflow.com/questions/8948803/what-does-git-remote-add-upstream-help-achieve">What does &#39;git remote add upstream&#39; help achieve?</a>, but in my opinion it does not explain exactly what the upstream is and what <code>git push -u origin master</code> does, especially what is <code>origin master</code> pointing to, is it the local repo or the remote repo?</p>