I need to create a patch file for the last N commits and apply them as separate commits to another branch. For N=3 I assume I have to do this:
git diff HEAD~3 HEAD~2 >> diff1
git diff HEAD~2 HEAD~1 >> diff2
git diff HEAD~1 HEAD >> diff3
and then apply them on another branch respectively:
git apply diff1
(push)
git apply diff2
(push)
git apply diff3
Is there any shorter way to do this?