gitGraph
commit
commit
branch FeatureA
commit
commit
branch FeatureAB
commit id: "AB1"
commit id: "AB2"
checkout main
commit
commit
checkout FeatureA
merge main
checkout FeatureAB
merge FeatureA
commit id: "AB3"
checkout main
commit id: "FeatureA (squash)" type: HIGHLIGHT
checkout FeatureAB
merge main
commit id: "AB4"
git fetch origin && git checkout origin/main # fresh off remote main
git checkout -b FeatureAB-cherry-pick
git cherry-pick `git rev-list --reverse --no-merges --first-parent AB1^..FeatureAB`
gitGraph
commit
commit
commit id: "FeatureA (squash-merge)" type: HIGHLIGHT
branch FeatureAB-cherry-pick
commit id: "AB1"
commit id: "AB2"
commit id: "AB3"
commit id: "AB4"
checkout main
commit
commit