How to restrict the naming of branches

Toan Luu Nguyen
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!
November 24, 2024

Hello,

Our team would like to follow best practices to name our branches based on certain rules like it should start with the developer's userid, followed by the Jira number, followed by Jira's title or short description of the Jira, e.g.,

th01552/RX25-Add-New-Search-Dialog

Is there a way to set that up via repository permissions and/or branch permissions, or some other methods.

Thank you.

1 answer

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2024

Hi @Toan Luu Nguyen

If you are using Bitbucket Cloud, currently Flowie and addon we provide, supports merge checks to validate the branch name using a regex and custom logic for PRs. Jira integration, which would support your scenario is being developed and is coming early next year. This only blocks the PR though.

If you want to prevent branches from being created incorrectly on remote at push time, since Bitbucket cloud has no support for server-side Git hooks, you could implement it via a Git hook on the client side. Once the Jira integration is in place, we also intend to add support to validate at push/commit time for a better developer experience.

If you are using Bitbucket DC, Better Commit Policy for Bitbucket might be what you are looking for.

Please feel free to contact us at support@flowie.app, mentioning this thread, and we can assist you with any queries you might have.

-Renato

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events