title: Getting existing git branches to track remote branches
body: <p>My usual workflow when working with git, is something like this:</p>
  
  <ol>
  <li>create a local repository</li>
  <li>do some work in that repository, add/change files etc.</li>
  <li>decide that I want a central remote location for the repository, and create one</li>
  <li>push all the commits from my local repository to this new remote repository</li>
  </ol>
  
  <p>Now, however, I want to be able to <code>push</code> and <code>pull</code> from this remote repository without having to specify where I'm pushing to or pulling from; I want my local master to track the remote master.</p>
  
  <p>The <em>proper</em> way to do this isn't clear to me, and I've been unable to determine it from the documentation, even though it shouldn't really be more than one command.</p>
  
  <p>Because it's something that's only ever done once per repository, I've generally employed one of two simple, but hacky, solutions:</p>
  
  <ol>
  <li>used <code>git clone</code> to make a new local repository, and deleted the old one. After git cloning, the new repository is setup to track the origin.</li>
  <li>manually edited .git/config to make master track origin.</li>
  </ol>
  
  <p>I think I should be able to run a command, probably some form of <code>git remote</code> to setup an existing repository to have master track a remote master. Can anyone tell me what that command is?</p>