provide read access to master branch only

elewinsohn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2018

I would like to give read access to my master branch to someone.

I don't want that someone to be able to see and pull all other branches.

How can I go about this?

Will I have to create a brand new repository for this purpose and only provide read access to it? if so, how can I automate the process of copying the master branch to this new repository periodically?

2 answers

1 accepted

0 votes
Answer accepted
elewinsohn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2018

We ended up doing the following:

  • created a new repository
  • added that repository as a remote repository
  • pushed the master branch to that new repository.
1 vote
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 6, 2018

Once you give a user access to the repo, he can see everything, including other branches and PRs. You can use branch restrictions to prevent updates to othee branches but they will still be able to see them.

An option is to create another repo from the master branch but you will have to use  basic git commands to keep them in sync or write an add-on that does it. You can also do something like a simple cron job that does it or have a CI server do that. Nothing out of the box in Bitbucket to do that though.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events