Checkout the branch from which you want to create the patch. Run this command:
git diff-index 79fd4d7 --binary > ~/Desktop/my-patch
Where 79fd4d7
is a placeholder for the commit that came right before the range of commits you want to diff. (e.g. I want a patch that contains the first three commits below:
aaa02b0 third commit mine
aabbbcc second commit mine
bb82aed first commit mine
79fd4d7 old commit
Then checkout your new branch and run git apply ~/Desktop/my-patch
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…