Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Enforce PR Title as Squash Commit Message

Oleh Malyshkin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 12, 2026

My team are using squash merge for pull requests and would like the final commit message after merge to always match the PR title automatically.
Currently, the squash commit message can be edited manually during merge, which makes it difficult to maintain consistent commit history.
Is there any way to enforce that the squash commit message is automatically set to the PR title?
If this is not supported natively in Bitbucket Cloud, could you please advise on the recommended approach to enforce this behavior?

2 answers

1 vote
Aron Gombas _Midori_
Community Champion
February 13, 2026

As @Saxea _Flowie_ suggested you could build a Forge app for this.

The Better Commit Policy Connector Bitbucket Cloud app can enforce certain rules on pull requests like:

  1. Regular expression, work item keys, etc. on pull request title
  2. Regular expression, work item keys, etc. on pull request description

With some creative configuration these may help you to enforce a policy, even if that is precise matching between a commit message and the pull request title. Those pull requests that are not satisfying the policy cannot be merged until the author fixes every problem:

bitbucket-cloud-rejected-pull-request.png

Give it a try.

(This app is developed and supported by our team.)

1 vote
Saxea _Flowie_
Atlassian Partner
February 12, 2026

Bitbucket doesn't support it out of the box, but you could extend it using Forge to implement it yourself. You could use a check to enforce it - which would just block but not change or set it automatically.

Alternatively we have an Bitbucket cloud app, Flowie, which allow you to disable the commit message input and set a template.

In your case the relevant bit of the config would look something like: 

 merge({
strategies: "squash",
commitMessageTemplate: ({pullRequest}) => `${pullRequest.title}`,
// Disable all options, including the commit message
select: false,
}),

 Hope this helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events