How to change the default "Squash & Merge" commit message?

When “Squash & Merge” a branch in a PR, the default commit message is either:

  • the commit message of the the commit in the PR, if the PR has a single commit;

  • the title of the PR’s and the description from all commits’ titles, if the PR has more than one commits.

As this behavior is inconsistent, it often result in inconsistent merge messages.  Is there a way to configure the default commit message for “Squash & Merge”?

57 Likes

always commit more than once :stuck_out_tongue:

1 Like

I’ve always thought you could just change the commit message while comitting? If you’re talking about changing the deafult one, I don’t think so.

Big +1 to being able to change this. I’d love for the default squash and merge message to be the PR description (raw markdown text with commentst stripped out). In our workflows, the PR description contains much more meaningful content than the individual commit messages on a branch.

30 Likes

Hi @jkillian,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve shared your feedback with the appropriate teams for consideration.

Please let me know if you have any other questions.

Thanks!

13 Likes

Any news on this?

4 Likes

I’d really like this too. The whole reason our team uses Squash and Merge is to remove all our awful “fix a typo”, “lint”, “$#@*#!” commit messages. We force developers to write a clear description as a condition of a PR being considered “reviewable”.

4 Likes

This feature would be amazing to have! We don’t really care about the commit history when merging and any pertinent information is always avaiable in the PR description. A configuration to pull in the message from the PR’s description would be really helpful.

1 Like

+1 to this enhancement! We force everyone to squash and merge PRs in our repo so the individual commit messages within the PR are just for the PR author. All the squashed commits aren’t relevant in the final commit description, so we would rather just automatically use the PR description. Thanks!!

3 Likes

A “–fast-forward” on this would be greatly appreciated! :smiley:

2 Likes

When using GitHub pull request template, it does not make much sense to use description nor does it make sense to get a list of all the commits.

I would love it if I can just to the default behavior to be blank!

Perhaps something configurable in the .github folder?

Or once GitHub workflow becomes publically available, I can automate the behavior myself.

4 Likes

I would totally love to be able to automatically disregard commit history message in squashed commit - now we are forced to do that with every merge!

2 Likes

This extension will remove the commit message 💪 Hope you find it useful @zuzusik 

https://chrome.google.com/webstore/detail/nbfokejcabfpamholnocfbemmfhjaapj

https://addons.mozilla.org/en-US/firefox/addon/github-no-to-merge-description/

Source code: https://github.com/casz/no-merge-description-extension

3 Likes

For my use case, even just a checkbox option that lets you treat all PRs as if they have multiple-commits would suffice.

I made a browser extension to use the PR description as the squash and merge commit message.

https://github.com/zachwhaley/squashed-merge-message

5 Likes

Wow, that looks great @zachwhaley ! Thanks so much for making & sharing it with us!

2 Likes

This may be a tad different than what’s requested but the simple ability to edit the commit message would be great. We use a tool to generate release notes from our commit log and it’s messy if a PR has multiple commits and not all the commit messages were written correctly. The squash & merge just concatenates all the messages but it would be nice to be able to pick one.

Would greatly appreciate if this is implemented.

2 Likes

This would be so useful! I would love to be able to use the PR message as the commit message. This would allow one place where developers have to write a well formed description of the change rather than having to have it in multiple places. Any updates on this?

2 Likes

Yeah, we have a few team members who squash and merge PRs without really paying attention thinking that it will use the PR title + description as the commit message. Would be really great to have this as the default option.