简体   繁体   English

Github:使用拉取请求描述作为合并提交消息?

[英]Github: use pull request description as merge commit message?

Using Github to manage a repo, by default, the pull request title is used as the merge commit message.使用 Github 管理 repo,默认情况下,拉取请求标题用作合并提交消息。

I would like to use the pull request body as the default merge commit message.我想使用拉取请求正文作为默认的合并提交消息。 Yes, I could copy-paste this into the editor whenever merging a PR, but I'd rather automate this part of the process and not rely on the PR author to remember to copy-paste.是的,我可以在合并 PR 时将其复制粘贴到编辑器中,但我宁愿自动化这部分过程,而不是依赖 PR 作者记住复制粘贴。

Is there a configuration option to do this somewhere that I'm missing, or a plugin or automated tool that does something like this?是否有一个配置选项可以在我缺少的地方执行此操作,或者有一个插件或自动化工具可以执行此类操作? Thanks!谢谢!

A screenshot of creating a Github PR to make it clear:创建 Github PR 的屏幕截图以说明清楚:

Github PR 创建画面

(Note that I'm not looking for evangelism about what PRs or commit messages should look like, just technical advice on how to achieve a specific goal.) (请注意,我不是在寻找关于 PR 或提交信息应该是什么样子的宣传,只是关于如何实现特定目标的技术建议。)

Per this documentation , the default generated commit message depends on the number of commits in the PR - if it's one, that commit message is used.根据本文档,默认生成的提交消息取决于 PR 中的提交数量 - 如果是一个,则使用该提交消息。 If it's more, the summary will be the PR title, and the description will be a list of the commits in the PR.如果更多,摘要将是 PR 标题,描述将是 PR 中的提交列表。

The only configuration option I find in the docs relating to this is here , which allows you to default to using the PR title for all squash merges.我在与此相关的文档中找到的唯一配置选项是here ,它允许您默认为所有 squash 合并使用 PR 标题。 Currently I don't believe there is a way to accomplish what you want without just copy-pasting it yourself.目前我不相信有一种方法可以完成你想要的而不只是自己复制粘贴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM