It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Branch restriction: read/write feature branches only

Rob Christian Aug 28, 2017

Is there not a way to restrict permissions to a group or team member, so they can only write to feature branches? Also, they should be able to push their own new feature branches, and create PR's, but not merge.

 

I would think this would be a common set of permissions a team leader would want but I don't see a way to get this working.

1 answer

1 accepted

0 votes
Answer accepted
G. Sylvie Davies [bit-booster.com] Community Leader Aug 28, 2017

It's possible using the "Branch Permissions" feature under the repository's settings.  Are you on Bitbucket Cloud or Bitbucket Server?

Rob Christian Aug 29, 2017

I don't know, there's no label. I open bitbucket.org, that's what I'm using.

Could you include something more specific? I'm using branch permissions, I don't see what I'm looking for. I would expect that I set read-only permission for my developers group, then add write permission for a branch pattern, but this doesn't seem possible.

Jim Redmond Atlassian Team Aug 29, 2017

The documentation for branch permissions in BB Cloud (bitbucket.org) is at https://confluence.atlassian.com/bitbucket/branch-permissions-385912271.html .

I'm not sure exactly what you're after, but it sounds like something along these lines for the master branch:

  • Nobody is listed in the "write access" field (or, alternately, there's an admin user or group listed there)
  • "Allow rewriting branch history" is not checked
  • "Allow deleting branch" is not checked
  • The developer group (or an admin group, or a QA group, etc.) is listed in the "merge via pull request" field

That will prevent direct writes, rebases, or branch deletions on master, while still permitting people to use the PR workflow to merge their things.

You can also use a wildcard to define additional branch permissions on feature branches. However, it will be much simpler to define branch permissions on master or on a set of primary branches, and leave feature branches as they are.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,322 views 3 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you