Where is the "Prevent changes without a pull request" restriction?
Asked by siva:

I want to prevent direct commits to specific branches and allow only pull requests. I have created a branch restriction but didn't see any option which allows for this. The documentation shows a "prevent changes without a pull request" checkbox ( <https://confluence.atlassian.com/bitbucketserver/using-branch-permissions-776639807.html> ) but I don't see it. This is what is shown in the branch restrictions tab, under Workflow in the Repository Settings page -

![Screenshot from 2023-02-15 19-25-07.png](/t5/image/serverpage/image-id/240338i0F9F6AC1D4F47F91/image-size/large?v=v2&px=999 "Screenshot from 2023-02-15 19-25-07.png")


Answers:
author: Petrus Hakakoski
body: The documentation you linked is for the BitBucket Server, a self-hosted BitBucket with more control like the feature you want.

comments: author: siva
body: Ah ok, thanks. I didn't notice the "Data Center and Server" part in the breadcrumbs there.


author: Theodora Boudale
body: Hi [@siva](/t5/user/viewprofilepage/user-id/3162728),

You can actually achieve what you want by changing the setting in **Write access** to **Only specific people or groups have write access**, and then leave the field below it empty:

![Screenshot 2023-02-17 at 12.08.28.png](https://community.atlassian.com/t5/image/serverpage/image-id/240926i0AFDEF8084B190B5/image-size/large?v=v2&px=999 "Screenshot 2023-02-17 at 12.08.28.png")

<br />

With a setting like this, no one will be able to push commits to the branch(es) with that branch restriction.

You can also limit the users who can merge via pull request with the **Only specific people or groups have merge access option** , in the **Merge access via pull requests** section. If you don't want to restrict this, you can of course leave it to **Everyone with access to the repository has merge access**.

If you have any questions, please feel free to let me know!

Kind regards,  
Theodora

comments: author: siva
body: Thank you. I wondered whether this would work but haven't tried it out yet.


author: Theodora Boudale
body: You are welcome Siva. Please feel free to reach out if you have any other questions!


author: Sergey Makarov
body: If I make configuration like in your picture then I can't create branch with specific pattern.

For example, I want to forbid write access to branch with pattern release-\* without pull request. If I make setting like on your image then I can't create branch with name release-1.


author: Theodora Boudale
body: Hi Sergey,

I'm afraid that this use case is not supported in Bitbucket Cloud at the moment.

We have a feature request for what you are asking:

* <https://jira.atlassian.com/browse/BCLOUD-15220>

I would suggest adding your vote to that feature request (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud