I have tested that some days ago, after reading the very clear explanation of Vonc.
dev
: A B C D E F G H I Jtarget
: A B C DE
nor H
dev_feature_wo_E_H
git checkout dev
git checkout -b dev_feature_wo_E_H
git rebase --interactive --rebase-merges --no-ff D
where I put drop
front of E
and H
in the rebase editorcommit
dev_feature_wo_E_H
on target.git checkout target
git merge --no-ff --no-commit dev_feature_wo_E_H
commit
cherry-pick
in the days before git cherry-pick
is powerful and simple but
merge
I have to resolve conflicts of the initial commits and duplicates commits, so for one or two cherry-pick
, it's OK to "cherry-picking" but for more it's too verbose and the branch will become too complexgit rebase --onto