title: Understanding "git pull --rebase" vs "git rebase"
body: <p>According to my understanding of <code>git pull --rebase origin master</code>, it should be the equivalent of running the following commands:</p>
  
  <pre><code>(from branch master):  $ git fetch origin
  (from branch master):  $ git rebase origin/master
  </code></pre>
  
  <p>I seem to have found some case where this doesn't work as expected.  In my workspace, I have the following setup:</p>
  
  <ul>
  <li>branch <code>origin/master</code> references branch <code>master</code> on remote <code>origin</code></li>
  <li>branch <code>master</code> is set up to track <code>origin/master</code>, and is <em>behind</em> master by several commits.</li>
  <li>branch <code>feature</code> is set up to track local branch <code>master</code>, and <em>ahead</em> of <code>master</code> by several commits.</li>
  </ul>
  
  <p>Sometimes, I will lose commits by running the following sequence of steps</p>
  
  <pre><code>(from branch master):  $ git pull --rebase
  (from branch master):  $ git checkout feature
  (from branch feature): $ git pull --rebase
  </code></pre>
  
  <p>At this point, the few commits ahead I was on <code>feature</code> have now been lost.  Now, if I reset my position, and instead do the following:</p>
  
  <pre><code>(from branch feature): $ git reset --hard HEAD@{2} # rewind to before second git pull
  (from branch feature): $ git rebase master
  </code></pre>
  
  <p>The commits have been applied correctly and my new commits on <code>feature</code> are still present.  This seems to directly contradict my understanding of how <code>git pull</code> works, unless <code>git fetch .</code> does something stranger than I expected.</p>
  
  <p>Unfortunately, this is not 100% reproducible for all commits.  When it does work for a commit, though, it works every time.</p>
  
  <p><strong>Note:</strong> My <code>git pull --rebase</code> here should actually be read as a <code>--rebase=preserve</code>, if that matters.  I have the following in my <code>~/.gitconfig</code>:</p>
  
  <pre><code>[pull]
      rebase = preserve
  </code></pre>