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:
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:
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?
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: https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag
Right now, all of your branches will show up in that dropdown if they have been pushed up to Bitbucket.
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 -
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Master
-> 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Time to up your Loom game! The new Loom Essentials Certification is here! Show off your skills, learn pro tips, and get officially recognized. Perfect for taking your video messaging to the next level.
Learn moreOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.