git cherry-pick FIRST^..LAST
works only for simple scenarios.
To achieve a decent "merge it into the integration branch" while having the usal comfort with things like auto-skipping of already integrated picks, transplanting diamond-merges, interactive control ...) better use a rebase. One answer here pointed to that, however the protocol included a dicey git branch -f
and a juggling with a temp branch. Here a straight robust method:
git rebase -i FIRST LAST~0 --onto integration
git rebase @ integration
The -i
allows for interactive control.
The ~0
ensures a detached rebase (not moving the / another branch) in case LAST is a branch name. It can be omitted otherwise. The second rebase command just moves the integration
branch ref in safe manner forward to the intermediate detached head - it doesn't introduce new commits. To rebase a complex structure with merge diamonds etc. consider --rebase-merges
or --rebase-merges=rebase-cousins
in the first rebase.