Branching a Branch

Whenever I try to change the destination branch of a branch to another branch it never actually changes and just stays as the master branch. I have also tried specifying the source branch when creating a new branch, but it always just branches of the main branch. I am using GIT.

Is this possible, or is there a reason why i wouldnt be able to do this?

2 answers

Are you asking about bitbucket or sourcetree? I don't know what "destination branch" means in the context of bitbucket.

Theo hussey Yes that is possible. You can create a branch off another branch simply by:

git checkout -b branch2 branch1

So above command will create a new branch "branch2" off "branch1". If you look at the workign directory when switching between these branches you will find them identical since you've created "branch2" from "branch1".

What version of git are you using? It might also be possible that when you are branching from another branch, that branch might be having same source as the master and hence you think its branching off master. You can double check that just to be sure.

Hope this helps.

In the SourceTree UI, you should checkout the branch you want to branch off of. In chirag's example, checkout "branch1", then use the Branch button to create "branch2".

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

68 views 2 3
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you