我在 github 上有一个 repo,其他人(Bob,为了论证)已经为其发出了 pull request。他的代码并不完美,因此我们进行了几轮标记。据我了解,他为每组标记的更改提交并推送他的 pull 请求。
所以我的存储库现在看起来像这样:
master: ---o A (Chowlett
|
|
pull-req: o---o---o---o
B C D (all Bob)
提交 SHA 和消息如下:
答:
123456 Good commit <chowlett>
乙:
777ccc Fix the widget bug <bob>
C:
888ddd Review markups <bob>
D:
999eee Further markups <bob>
我现在很高兴接受这个 pull 请求;但我宁愿预标记版本不在我的仓库中。我可以实现以下所有目标吗?以及如何?
- 将 B、C 和 D 作为单个提交 merge 到我的仓库中
- 同时生成“Merge pull request #99 into ...”提交
- 让github自动关闭pull request
最佳答案
请注意,Bob 在进行 GitHub PR 时不必压缩他的提交。
自 2016 年 3 月起,您可以将该操作留给接受您的 PR 的维护者(您)。
参见“Squash your commits”及其new documentation
This is a new option which lets you force commit squashing on all pull requests merged via the merge button.
关于git - 压缩到只有一个 "proper"提交 github pull 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11396069/