Github PR 时合并多次提交的 git commits All In One
使用场景:(一个组里的兄弟)
在一个分支里,提交多次,产生多个commit,然后提pr。
正常情况下,合并到main分支,也会带着多次pr。
期望:将分支中多个commit在合并至main时变为一个commit
解决办法:

终极解决办法(原理):

https://docs.github.com/zh/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests