There is a commit policy plugin for Bitbucket server and data center but I can't find anything for cloud. I need to implement a specific format. In order to link our JIRA issues to the commits we're focusing on smart commits. But in order to enforce the smart commit policy I need to set up a gate so I only commit with proper format followed go through.
Hi @Ci Admin ,
I'm afraid that this is not possible in Bitbucket Cloud. We have an option to enforce JIRA issues keys in commit message (it can be found in Repository settings > Links), but we don't support server side hooks at the moment that would allow rejecting commits based on the commit message format.
We have a feature request for a server-side pre-receive hook that you can vote for, add yourself as a watcher and also leave any feedback:
In the meantime, the suggestion I can make as a workaround would be to use client side hooks, you can check an example here:
These will need to be configured by every user in the local clone of the repo they are working on, in the .git/hooks directory of the local repo. From the link I included above:
Because hooks aren’t transferred with a clone of a project, you must distribute these scripts some other way and then have your users copy them to their .git/hooks directory and make them executable.
Please feel free to let me know if you have any questions.
Kind regards,
Theodora
We have added commit policy support to Flowie, a Bitbucket Cloud addon. It creates checks against the commit message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ci Admin
Do you use Jira in Cloud as well (at all?) In the off chance that you also use Jira Server or Data Center, you can implement (have your developers install) a local commit verification hook script that would enforce your rules. Read more on this here.
I know it's a cumbersome workaround and only works if you have Jira Server/DC, but it's the best we could come up with until BCLOUD-10471 is not implemented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.