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

前端 未结 8 1090
無奈伤痛
無奈伤痛 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:34

    Based on Adam Alexander's answer:

    git checkout newlines
    ## must be rebased to master
    git checkout -b temporary
    # squash the commits
    git rebase -i master
    git format-patch master
    

提交回复
热议问题