title: git squash older commits (not last one)
body: <p>I have a very messy git history. I want to squash a bunch of older commits (not including the last one).</p>
  
  <p>I know how to squash my last <code>n</code> commits. But this is different. Here I have commits consecutively <code>n1</code> to <code>n2</code> which I want to squash into one, while after <code>n2</code> I have a history of commits that I want to preserve up to the last one.</p>
  
  <p>So, if my current history looks like this:</p>
  
  <pre><code>---- n1 --- n2 -------- m
  </code></pre>
  
  <p>I want to squash <code>n1</code> to <code>n2</code> so it ends up looking like this:</p>
  
  <pre><code>---- n1n2 -------- m
  </code></pre>
  
  <p>where <code>n1n2</code> is a single commit containing the squashed contents from <code>n1</code> to <code>n2</code>.</p>
  
  <p>How should I do this? What are the consequences on the history from <code>n2</code> to <code>m</code>? </p>
  
  <p>That is, <strong>will the hash of every commit from <code>n2</code> to <code>m</code> change as a consequence of what I want to do?</strong></p>