title: Merging a branch of a branch after first branch is squashed when merged to master
body: <p>Here's a workflow that I commonly deal with at work.</p>
  
  <pre><code>git checkout -b feature_branch
  # Do some development
  git add .
  git commit
  git push origin feature_branch
  </code></pre>
  
  <p>At this point the feature branch is up for review from my colleagues, but I want to keep developing on other features that are dependent on <code>feature_branch</code>.  So while <code>feature_branch</code> is in review...</p>
  
  <pre><code>git checkout feature_branch
  git checkout -b dependent_branch
  # Do some more development
  git add .
  git commit
  </code></pre>
  
  <p>Now I make some changes in response to the code review on feature_branch</p>
  
  <pre><code>git checkout feature_branch
  # Do review fixes
  git add .
  git commit
  git checkout dependent_branch
  git merge feature_branch
  </code></pre>
  
  <p>Now this is where we get have problems.  We have a squash policy on master, which means that feature branches that are merged into master have to be squashed into a single commit.</p>
  
  <pre><code>git checkout feature_branch
  git log # Look for hash at beginning of branch
  git rebase -i  first_hash_of_branch # Squash feature_branch into a single commit
  git merge master
  </code></pre>
  
  <p>Everything is cool, except with <code>dependent_branch</code>. When I try to rebase dependent branch onto master or try and merge master into it, git is confused by the re-written/squashed history and basically marks every single change in <code>depedendent_branch</code> as a conflict.  It's a PITA to go through and basically re-do or de-conflicticize all of the changes in <code>dependent_branch</code>. Is there some solution to this?  Sometimes, I'll manually create a patch and apply it off a fresh branch of master, but if there's any real conflicts with that, its even worse to fix.</p>
  
  <pre><code>git checkout dependent_branch
  git diff &gt; ~/Desktop/dependent_branch.diff
  git checkout master
  git checkout -b new_dependent_branch
  patch -p1 &lt; ~/Desktop/dependent_branch.diff
  # Pray for a clean apply.
  </code></pre>
  
  <p>Any ideas?  I know this happens because of the re-written history during the squash, but that's a requirement that I can't change.  What's the best solution / workaround?  Is there some magic I can do?  Or is there a faster way to do all the steps involved with manually creating the diff?</p>