G---H // Release Branch
/
/
A---B---E---F--- // master
\\
\\
C---D--- // bug fix branch
Based on our particular ne
Create a patch file containing the unique content from the bugfix branch. Then apply that patch file to the release branch.
Example:
> git checkout bugfix_branch
> git diff B HEAD > unique_changes.patch /* where "B" is the point where bugfix_branch split from dev */
> git checkout release_branch
> git apply unique_changes.patch
Et voila! You now have only the unique changes from the bugfix branch in your release branch. Note that format-patch
tends to more gracefully handle situations where files have been moved or deleted, so you may need to play around with the actual process by which the patch is generated, but this approach should get you close.