title: rebase branch to squash history with merge commits
body: <p>I have the following situation in my branch:
  <img src="https://i.stack.imgur.com/Rtpng.png" alt="enter image description here"></p>
  
  <p>As you can see, another branch (green) was created from our main branch (red) some time ago, some commits where added and it was then merged back onto our main branch, which did not receive any commits in the mean time. Some more commits have been added to the red branch since then, so our Head is actually a little further to the left.</p>
  
  <p>How would I go about rebasing this branch onto itself (the first commit all the way to the right) to squash it's commit history, including all the commits from the green branch into the red branch (so I actually only have on single branch left) ?</p>
  
  <p><strong>EDIT</strong>
  I managed to solve it by soft resetting the HEAD back to e , squashing everything before, then soft resetting the branch to a, committing b, c and d onto a and then applying my stashed contents. Quick and worked like a charm!</p>
  
  <p>Thanks for your help!</p>