Smart Branching in Bit Bucket

Introduction

 
Recently, Atlassian announced a recent update for the Bitbucket which is called smart feature branching. This means that now we can add the branch type in the branching workflow, which makes our life easier while working on patchwork and hot fixes for production and so on.
 

Enabling the Branching Type

 
Login into the Bitbucket and go-to the repository where you need to enable the new branching model, as shown in the below figure
 
Smart Branching In Bit Bucket
 
In the Branching model, define how you want to name your branches. Here, we need to specify the development and production branch
 
Smart Branching In Bit Bucket
 
Next is the Branch prefix, which is used to make the branch types clear, as shown in the below figure
 
Smart Branching In Bit Bucket
 
Save the settings.
 

Create a branch

 
Now while creating a branch, you can notice the branch type section as shown in the below figure.
 
Smart Branching In Bit Bucket
 

Branch filter

 
Now we can also search the branch using the branch type filtering, as shown in the below figure. 
 
Smart Branching In Bit Bucket
 

Branch Permission

 
Now we can set branch permission based on branch type
 
Go to repository settings -> Branch Permission - > Add a branch permission. Now you can see the branch type option in the branch permission window as shown in the below figure.
 
Smart Branching In Bit Bucket
 
Click on Add a branch permission to add a permission to the user to access branch based on branch type.
 
Smart Branching In Bit Bucket
Smart Branching In Bit Bucket
 
From the above figure you can notice, the write access for the hotfix branches in the current repository is given to the user Gowtham. This is how you can provide access to the user based on branch type using the bitbucket smart branching feature.
 

Summary

 
We learned the following things in bit bucket smart branching:
  • New branching model in bit bucket with branch type
  • Enabling the branch type for the repository
  • Branch filter using branch type
  • Assigning branch permissions based on branch type