How do you squash commits into one patch with git format-patch?

前端 未结 8 1103
無奈伤痛
無奈伤痛 2020-11-30 16:58

I\'ve got eight commits on a branch that I\'d like to email to some people who aren\'t git enlightened, yet. So far, everything I do either gives me 8 patch files, or start

8条回答
  •  佛祖请我去吃肉
    2020-11-30 17:32

    Just to add one more solution to the pot: If you use this instead:

    git format-patch master --stdout > my_new_patch.diff
    

    Then it will still be 8 patches... but they'll all be in a single patchfile and will apply as one with:

    git am < my_new_patch.diff
    

提交回复
热议问题