Friday, November 22, 2024
Google search engine
HomeData Modelling & AIHow to add Branch Permissions to a repository in Bitbucket

How to add Branch Permissions to a repository in Bitbucket

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

There are those repositories that have extremely sensitive pipelines in your Bitbucket and they must have the right permissions so that sanity and checks can be achieved. We recently showcased how to manage Cloudflare records via Terraform and Bitbucket Pipelines and such is the kind of repository that you should protect. This is because DNS records cannot be played around with and everyone in the team needs to be careful especially if you have multiple applications spread all over the place.

It is because of that that we are setting up branch permissions where we will specify who will have access to the branch, how we would like our Pull requests/Merge requests to take place and others as we we will see. So stay tuned to the end.

Step 1: Login to your Bitbucket Space

Of course we have to log into our specific Bitbucket spaces where our repositories reside. Kindly do so and navigate to your repository of interest.

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

Step 2: Repository Settings

Click on the repository settings where it will lead to a page with all the settings we would like to change. For this brief guide, let us focus on Branch Permissions.

Repository Settings

That will open the page below

Step 3: Branch Permissions

On the left pane from Step 2, click on “Branch Permissions”. If there were no permissions previously, there will be a page asking you to add new permissions. Since that is what we want to do, click on “Add a branch permission”.

Repository Branch Permissions

That will open a new page as shown below with all the settings we can alter to our desired state.

Repository Add Branch Permission

You can for example add a given number of reviewers that must approve a pull request before a merge happens, lock out direct editing of the main branch, prevent direct commits to a given branch and so forth. It is highly flexible and can fit any number of rules you would wish to enforce on your repository.

Closing Chymes

Hoping that the brief guide was as helpful as we intended, I think it is time that we finally conclude and let the year roll with a huge pinch of blessings, progress, more tech and more Love.

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments