From https://stackoverflow.com/questions/616556/how-do-you-squash-commits-into-one-patch-with-git-format-patch
# creating a patch git diff abcd..1234 > patch.diff git log abcd..1234 > patchmsg.txt # applying the patch: git apply patch.diff -v git add -A git reset patch.diff patchmsg.txt git commit -F patchmsg.txt