title: Git: merge only the changes made on the branch
body: <pre><code>  G---H             // Release Branch
   /
  /
  A---B---E---F---    // master
      \
       \
        C---D---     // bug fix branch
  </code></pre>
  
  <p>Based on our particular needs for our project, it is quite common for the above scenario to occur.  We have our master/dev branch with some commits.  Then we get a bug report and start fixing that on the bug branch (commits C and D above).  More commits happen in the dev branch in the meantime.  Next we are told we need to create a release for a customer which cannot include the changes introduced by commits B, E and F above, but it should include the bug fix.</p>
  
  <p>So we branch off of dev before change B was ever applied, but what is the best way to get the bug fix into this release branch too?  If I perform a merge of the branch it will include the change that was made in B which I don't want.  I could perform a cherry-pick of commits C and D but I read that cherry picking is not always a good idea <a href="https://stackoverflow.com/questions/880957/pull-all-commits-from-a-branch-push-specified-commits-to-another/881014#881014">based on this answer</a> basically because my repo would then look like:</p>
  
  <pre><code>  G---H---C'---D'--- // Release Branch
   /
  /
  A---B---E---F---     // master
      \
       \
        C---D---       // bug fix branch
  </code></pre>
  
  <p>So C' and D' appear as completely new commits with different sha-1 IDs as C and D.  Is this really a bad thing?  What problems can this lead to?  Is there a better way of getting the changes from the bug fix branch into the release branch?</p>