hoangdangninh
6/18/2017 - 6:50 AM

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