How to limit pushes, but allow pull requests?



I want to disallow commits (pushes) to the "develop" branch, because all code needs to be pushed to a separate branch and must me merged to the "develop" branche with a pull request.


When I use "Branche management" and limit the pushes, merging the pull request is also restricted.


Is it possible to disallow a direct push to a branch, but allow merge of a pull request?




3 answers

You can write a pre-recieve hook to deny pushes to certain branches.

Hi Harry,

Thank you for your answer. Unfortunately your solution seems to be for Stash only. For Bitbucket this is still a feature request (



I'm trying this too! 

Prevent any user from push ( has no utility if blocks merge in pull requests!! =/




Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

663 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot