Reputation: 328
Using Github to manage a repo, by default, the pull request title is used as the merge commit message.
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.
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:
(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.)
Upvotes: 11
Views: 4468
Reputation: 456
In the repository:
Settings > General > Pull Requests >
> Allow merge commits
> Default commit message
> Default to pull request title and description`
Alternatively, use PR description templating: The PR Description itself supports templating, but the merge-commit message does not. However, the Merge Commit Message is copied from the PR description. This allows setting up an additional template for the Merge Commit Message in the PR Description.
Upvotes: 12
Reputation: 1043
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. If it's more, the summary will be the PR title, and the description will be a list of the commits in the 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. Currently I don't believe there is a way to accomplish what you want without just copy-pasting it yourself.
Upvotes: 4