Is there an easy way to create a patch on one branch to apply to another branch if both branches share a common ancestor?

Viewed 32

I'll be referencing the graphic I made:

Repo commit structure

My question is: how do I generate patch Z to get from commit B to D?

I want only the functionality I added in Patch X (to get from commit A to C), but because commits A and B have diverged enough, that patch doesn't apply cleanly and leaves a lot of rejected hunks.

If I can create patch X and patch Y, is there a way to use patch Y as a "guide" for the patch program to know how to get from B to A, but don't apply patch Y and then apply patch X?

0 Answers
Related