Branch permissions to prevent branching from master

I know about repository and branch permissions. I know that branch perms only control which users/groups can commit/push/delete a given branch or branches within that repo. But what I would realy like is a branch perm that controls even the visibility, and therefore the availability of branching from a specific branch or branches. For example, I'd like only system admins (users who are members of the stash-admins group) to be able to branch from 'master', and allow everyone else to only branch from the 'development' and sundry feature branches. For those who are not in stash-admins, I don't even want them to see the 'master' branch in the "Branch from" drop-down in Stash's "Create branch" screen. Do-able?

1 answer

1 accepted

0 votes
Accepted answer

Hi Christopher,

With git, you can't restrict visibility to only part of the branches to some people. After all, when someone clones the repository they have access to the full history in their local clone. Once they've got the branch locally, they can do whatever they want (Stash is out of the loop).

However, if you really want to restrict branch visibility to a select group of users, you could create a fork of the repository and only create the branch in the fork. You can then restrict access to that fork.

Hope that helps!

Michael

Thank you, Michael. Since we're militarizing on branching only from JIRA issues via Stash app linking, and nowhere else, I had hoped that there might be a way, from the user and group permissions perspective of Stash, to inhibit the creation of branches from master for all those except admins. I suppose this will just have to be a policy and education matter. Thanks.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

194 views 3 6
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