title: How to 'git pull' into a branch that is not the current one?
body: <p>When you run <code>git pull</code> on the <code>master</code> branch, it typically pulls from <code>origin/master</code>.  I am in a different branch called <code>newbranch</code>, but I need to run a command that does a <code>git pull</code> from <code>origin/master</code> into <code>master</code> but I cannot run <code>git checkout</code> to change the selected branch until after the pull is complete.  Is there a way to do this?</p>
  
  <p>To give some background, the repository stores a website.  I have made some changes in <code>newbranch</code> and deployed them by switching the website to <code>newbranch</code>.  Now those changes have been merged upstream into the <code>master</code> branch, I am trying to switch the website back to the <code>master</code> branch as well.  At this point, <code>newbranch</code> and <code>origin/master</code> are identical, but <code>master</code> is lagging behind <code>origin/master</code> and needs to be updated.  The problem is, if I do it the traditional way:</p>
  
  <pre><code>$ git checkout master
     # Uh oh, production website has now reverted back to old version in master
  $ git pull
     # Website is now up to date again
  </code></pre>
  
  <p>I need to achieve the same as above (<code>git checkout master &amp;&amp; git pull</code>), but without changing the working directory to an earlier revision during the process.</p>