Hello,
I want to enforce permissions at the project level so that when a DevOps engineer creates the repo by default it's locked up. How I've established the branch permissions at the project level is that for the master branch I'm preventing 'Rewrite history' and 'Deletion' for everyone. 'All changes' is only allowed for our CI/CD user. Now the problem is because of this I can't actually create the master branch itself. How can I get Bitbucket to automatically create the master branch? Or how do I allow access to *just* create the master branch to a certain group and nothing? I don't want to allow a specific group to the list of 'Exemptions' for 'All changes' and I'd still like to enforce these permissions on a project level. Thanks in advance.
Hi @Mugurel,
Apologies if you were notified of my previous (incorrect) responses - I misread your question.
I think that the problem here is that you want to restrict 'all changes' for the master branch. This setting can be used in a number of different ways. In your case, you'd like the creation of that branch to be allowed but further modifications to be restricted. In other cases, they may want to restrict branches from ever being created in the first place. This setting is for the latter case - restriction all changes, including creation
There are a few options you could look into:
1. Instead of using the 'branch name' setting when creating your branch permission, use the 'branch model' setting. By selecting 'Development Branch' (which defaults to master) you will allow users to push up master because the default branch gets set after the push succeeds.
2. Get your CI tool to create the master branch
3. Allow another user as an 'exception' to the rule so that they can create the master branch
Hope one of these options are what you're looking for,
Kristy
Control Freak for Bitbucket Server is a paid add-on that should work well for your situation. It lets you define your rules globally (or per-project or per-repo).
You can configure "Control Freak" to only apply its rules against non-empty repos. This way anyone can create an initial master branch, since the rules won't apply for the very first push.
- Sylvie
(We maintain 3 paid add-ons: Control Freak, Git Graph for JIRA, and Rebase Squash Amend).
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.