title: How do I trivially linearize my git history?
body: <h1>Question</h1>
  
  <p>Given that I have a commit like the following:</p>
  
  <pre><code>A - B - C - D - G - H
       \         /
        - E - F -
  </code></pre>
  
  <p>How do I get a perfectly linear history following only the first parents?</p>
  
  <p>Eg, I want to get:</p>
  
  <pre><code>A - B - C - D - G'- H'
  </code></pre>
  
  <p>It is expected that the sha1's of G and H will change, as noted above. (For obvious reasons). If the sha1's for A, B, C, and D change as well, then I want to know why.</p>
  
  <h1>Background</h1>
  
  <p>The intention is to avoid potential merge commits that would arise when doing a naive git rebase -i.</p>
  
  <p>The real point is to hopefully gain additional insight in order to determine which commits are in a particular branch, eg, if we have the following graph:</p>
  
  <pre><code>I - J - K - L - M
   \     /   /   / 
    - N - O - P -
  </code></pre>
  
  <p>Where N was merged into K, but O was merged with --strategy=ours into L, and P was merged into M.</p>
  
  <p>I want to be able to linearlize my history so that such problematic commits can be identified, and inspected.  I want to have a tree where can identify that O was not put into the upstream branch, even if I potentially identify N and P as being potentially missing from the upstream branch as well, by using git cherry, however any suggestions here would be appreciated.</p>