Scenario:
master
|
\
dev
|
\
feature1
|
|
|
/
|
/
tagV1
|
\
feature2
|
|
/
|
/
tagV2
|
\
fixForV1
|
|
/
|
/
tagV1_1
Description:
15… We need to merge tagV1 and the commits made on fixForV1 (Without including the commits made on feature2). After the merge we will create a new tag tagV1_1 and deliver this to the customer.
I know I can achieve this by doing a cherry-pick {hash of first commit made on fixForV1} ^..{hash of last commit made on fixForV1} Is there a better way to do this?
If I understand your requirements correctly, you can also work like this:
git checkout fixForV1
git format-patch tagV2
-- get all the patches from tagV2 to head of fixForV1git checkout -b branchV1 tagV1
-- create a new branch based on tagV1git apply *.patch
-- apply patches we generated in step 1If you are lucky, all patches apply without issue then you're done. If not lucky, apply the patches one by one in order then fix the conflicts accordingly.