Bat
Bat

Reputation: 255

How do I allow read access only to the master branch of a bitbucket repo

We have a private repo on bitbucket for a client and as part of their disaster recovery strategy, they'd like to be able to access the codebase. Is there a way to make the master branch of the repo available to them without giving access to all of the pull requests, commits and branches?

I can set up a user with readonly access on the repo but they can still view everything and comment in pull requests etc. and I'd prefer if the dev team could comment freely in there and prototyped code or tracers were kept private.

What's the best practice for sharing production code with a client/customer? Can I share just one branch with another bitbucket or github account?

Upvotes: 2

Views: 3553

Answers (1)

WPrecht
WPrecht

Reputation: 1382

Per the Atlassian documentation, read access grants the following:

View, clone, and fork the repository code. All public repositories 
grant all Bitbucket Cloud users read permissions automatically. 
Read access on a repository also allows users to create issues, 
comment on issues, and edit wiki pages.

Which sounds like just what you want except that it's all the branches in that repo, not just master. Probably the only way to provide the 'public' view you want is clone the master branch to a separate repo. Atlassian doesn't provide the granularity of permissions to fine tune it further. So you would need a process to keep the "public" master in synch with the real master.

Upvotes: 2

Related Questions