title: Merge, update, and pull Git branches without using checkouts
body: <p>I work on a project that has 2 branches, A and B. I typically work on branch A, and merge stuff from branch B. For the merging, I would typically do:</p>
  
  <pre><code>git merge origin/branchB
  </code></pre>
  
  <p>However, I would also like to keep a local copy of branch B, as I may occasionally check out the branch without first merging with my branch A. For this, I would do:</p>
  
  <pre><code>git checkout branchB
  git pull
  git checkout branchA
  </code></pre>
  
  <p>Is there a way to do the above in one command, and without having to switch branch back and forth? Should I be using <code>git update-ref</code> for that? How?</p>