Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating branch inside a branch

Hello, I have a situation where I need to maintain files that are highly categorized. Basically I am using BitBucket to store Test scripts related to multiple modules, this how it looks on a high level:

  1. A Git Project with my team name
  2. Many repositories for each Projects of my Organization
  3. Many branches inside each repository for different modules of a project

Now my issue comes where I need to further categorize many test scripts that I would like to maintain under these branches:

Suppose I have 5 different functionalities and I have written 5 test scripts. Each of the functionality is independent of each other, but comes under the same module. Therefore I will somehow have to keep the test scripts under the same repository, but still need to have a kind of separation. Because I do not want to pull all the remaining 9 test scripts if I wanted to modify one of them (This occurs if I keep all 10 test scripts under the same module branch).

Therefore I would like to create branches inside a branch to avoid checking out all other scripts. But when I did create a branch inside a branch, in BitBucket UI if I navigate to the base branch and list all the branches, even the sub-branches are listed, this will lead to a lot of confusion :( 

Here is a pictorial representation of my issue:


  1. Banner9 is my repository
  2. StudentSelfService and FacultySeslfService are my base branches under the repository
  3. Acceleration-Student-March-2020 is the new branch that I created INSIDE StudentSelfService branch, but it is showing up in the top hierarchy.

Is there anyway I could make the sub-branch (Acceleration-Student-March-2020) not come up if I list the branches being in the repository? Or is there any better way to have a further 'separation' between objects stored under the same branch?

3 answers

1 vote
Tyler T Atlassian Team Apr 14, 2020

Hello @Shantharam , welcome to the Community!

Git doesn't really have a concept of sub-branches.

You could look at git tags as a way to further organize your work:

Right now, all of your branches will show up in that dropdown if they have been pushed up to Bitbucket.

Hi @Shantharam ,

Yes, you can create sub-branches to any branch.

 Lets say you have a master branch then from the master branch you can create a sub-branch.


You can further create sub-branches from this child branch.

Here are the steps:

First, go to your repository then choose Branches. On the top right corner, there will be a button with a name Create branch. Click on this button.



Now choose your child branch as from branch and enter the name of your new branch.

Finally you will have following hierarchy:


          -> ChildBranch

                 -> GrandChildBranch and so on.


You can create any new branch from any existing branch, tag, commit, etc.

Hope it will help.


Kindly accept this answer if it resolves your query.

Hi @Shantharam 

Yes, It is possible to create a sub-branch in bitbucket. Even you can create branch to n level.

Let's say you have a master branch in any repository. Now you can create a child branch from  existing master branch.

Here are the steps - 

  • Open your repository
  • Go to Branches
  • Click on Create branch  button on the top right corner of the page

Now you will see the following window:


From branch: Choose the branch from which you want to create your new branch

Branch name: Enter the name of your new branch.

and click on the create button.

Now you have 2 branches in your repository.


Again repeat the same steps and this time choose your child branch in From branch and enter a new branch name. And you will get a sub-branch.



You can create sub-branches to any level. You can also create a branch from any commit, tag, etc.

Hope it will help.


Kindly accept this answer if this works for you.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

Share your use cases: How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features to how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your tea...

43 views 0 1
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you