Squash my last X commits together using Git

前端 未结 30 4069
醉酒成梦
醉酒成梦 2020-11-21 05:17

How can I squash my last X commits together into one commit using Git?

30条回答
  •  生来不讨喜
    2020-11-21 05:36

    If you want to squish every commit into a single commit (e.g. when releasing a project publicly for the first time), try:

    git checkout --orphan 
    git commit
    

提交回复
热议问题