title: What are the advantages of a rebase over a merge in git?
body: <p>In <a href="http://eagain.net/articles/git-for-computer-scientists/" rel="noreferrer">this article</a>, the author explains rebasing with this diagram:</p>
  
  <p><a href="https://i.stack.imgur.com/XodLC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XodLC.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p><strong>Rebase:</strong> If you have not yet published your
    branch, or have clearly communicated
    that others should not base their work
    on it, you have an alternative. You
    can rebase your branch, where instead
    of merging, your commit is replaced by
    another commit with a different
    parent, and your branch is moved
    there.</p>
  </blockquote>
  
  <p>while a normal merge would have looked like this:</p>
  
  <p><a href="https://i.stack.imgur.com/C75pG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/C75pG.png" alt="enter image description here"></a></p>
  
  <p>So, if you <strong>rebase</strong>, you are just losing a history state (which would be garbage collected sometime in the future). <strong>So, why would someone want to do a rebase at all?</strong> What am I missing here?</p>