This is a job for cherry-pick
. Try
git checkout dev-main
git cherry-pick K
git cherry-pick L
You can also use the syntax described in the gitrevisions
documentation to specify a range of commits. In this example you want to merge commits reachable from the new-feature
branch but not from the dev-team1
branch, so you could write
git checkout dev-main
git cherry-pick dev-team1..new-feature
Also check this post about how to merge a specific commit in Git.