We have a repo in Bitbucket that has a branch restriction where developers cannot write directly to branches called *-development. The intention was to force developers to open a feature/work branch instead, and then open a pull request from there.
Unfortunately, that currently means that nobody can create a branch called *-development, either.
Is there a way to allow users with write access to the repo the ability to create a new branch, but then not have the ability to commit directly to the branch?
I'm afraid this is not possible; the restriction prevents both operations. What I've typically seen done is assigning a group with someone like the project lead who can still have write permissions to create the branches. Depending on the workflow, it might be worth automating it. We provide a Bitbucket app to automate PR workflows, which might be useful in your case.
Hi Sam,
Saxea _Flowie_ is right, this is not possible at the moment. I just wanted to add we have a feature request that you can vote for and where you can add your feedback:
https://jira.atlassian.com/browse/BCLOUD-15220
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be able to still create a branch, even with a branch rule that you cannot make changes directly to the branch. How did you implement it?
I suggest to use branch permissions and prevent "Changes without a pull request". You may also want to consider preventing "Deletion" and "Rewriting history" along with this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Keep in mind though I am thinking of Bitbucket data center. I don't know if this is different in cloud.
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.