title: Git merge after git rebase?
body: <p>I was reading this article <a href="http://supercollider.github.io/development/git-cheat-sheet.html" rel="nofollow">http://supercollider.github.io/development/git-cheat-sheet.html</a>, which proposed the following workflow:</p>
  
  <pre><code>git checkout master
  git pull --rebase # update local from remote
  git rebase master chgs
  git checkout master
  git merge chgs
  git push
  </code></pre>
  
  <p>I'm sure I don't understand how this works and why it is useful. </p>
  
  <p>Doesn't the third line, <code>git rebase master somechanges</code>, put commits from <code>chgs</code> after the last commit from <code>master</code> but without merging them, and leaves <code>HEAD</code> pointing to the latest commit from <code>chgs</code>, like this:</p>
  
  <pre><code>(master-commit-n-1)&lt;--(master-commit-n)&lt;--(chgs-commit-k-1)&lt;--(chgs-commit-k)&lt;--HEAD
  </code></pre>
  
  <p>Does that leave me with <code>chgs</code> checked out? That's why I need to check out <code>master</code> again?</p>
  
  <p>And why do we need to merge the changes into master?  Doesn't that make a graph like this:</p>
  
  <pre><code>(master-commit-n-1)&lt;--(master-commit-n)&lt;--(chgs-commit-k-1)&lt;--(chgs-commit-k)
                                          \.(master-with-merged-chgs-commit-k)&lt;--HEAD
  </code></pre>
  
  <p>I don't see why the top fork is useful. </p>