If two or more remote branches are all on the same line, how do I select which one to check out?
Asked by Jack Zylkin:

If am having a major problem checking out branches. If several remote branches are all at the same commit as each other (for example, if I have just created a new branch), they all appear on the same line of the history. How the heck do you choose which one you want to check out?

Double clicking or right clicking "checkout" seems to check out one of the branches at random -- I think it must be whichever one already has a local branch created for it. Sourcetree does not prompt me to select which remote branch I actually want to check out locally.

Also, if I already have the master checked out, and I want to check out a branch that has just been branched off the master, the "checkout..." option is greyed out entirely. So, how do I switch between branches that are on the same line of the history???

(I am coming from GitExtensions, where you can right click on a row that contains several branch heads, and select which one you want to check out. If you select a remote branch that doesn't already have a corresponding local branch, it creates one for you and checks it out. How do I do this in SourceTree?)

![multiple branches.PNG](/t5/image/serverpage/image-id/44754i63DE954F097A0438/image-size/large?v=v2&px=999 "multiple branches.PNG")


Answers:
author: minnsey
body: Hi  

Select the required branch from the sidebar, either as a pre-existing local branch or from the list of remote branches. Either right clicking and selecting Checkout from the context menu or double clicking should do the trick for you.

comments: author: Jack Zylkin
body: Thanks for your answer, but I don't think this solves my problem. I am looking to check out a branch that I have never checked out before, using the tree to visualize what I am checking out. Finding the branch in the sidebar defeats the whole purpose of having the tree view. Also, a branch I have never checked out before will not show up in the sidebar, so by definition I cannot check out a new branch that way.

Sourcetree is useless to me without this feature, as I cannot create a branch in JIRA then check it out in Sourcetree later.


author: minnsey
body: Under the REMOTES heading in the sidebar you will see all the remote branches regardless of whether you have checked them out locally.  

The BRANCHESheading shows you only branches you have already checked out locally.


author: Jack Zylkin
body: Thanks for explaining -- it seems like your BRANCHES heading is named incorrectly.

Even so, that is only a workaround for my problem. I am trying to teach my team how to do version control and Git Extensions is the only tool that lets you click on the branch you want to check out in the tree view and have it actually check it out.

If you have a medium to large team with dozens of remote branches that may have similar names, your suggestion is wildly impractical.

It seems like a pretty basic behavior that is missing from Sourcetree.


author: Jack Zylkin
body: I am still waiting for a realistic answer to this fundamental question.

Without being able to check out a specific branch using the main tree view, Sourcetree is pretty useless. I can't understand how others are able to use it at all.

Its like I'm driving a car, and I come to a fork in the road, and the car decides for me which way to go. So useless.

Please admit this is a defect and add the ability to your software, or let me know in which version you removed this feature, so I can back up to it.


author: minnsey
body: Sorry I re-read your question.  

If you right click on the row in the Log View and choose *Checkout...* you will be presented with a dialog giving you the ability to choose the branch.  

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/47343iF205EAD69D158EA9/image-size/large?v=v2&px=999 "Capture.PNG")


author: Jack Zylkin
body: Thank you for understanding my problem.

I do not get this dialog on Windows 10, and neither do my colleagues. I have tried this on many versions of Sourcetree. I do not get a "Pick Branch" dialog. This sounds like a bug.

I assume by "Log View" you mean the main tree view.


author: Jack Zylkin
body: I tried your suggestion (though I have done it many times in the past with no luck) and I was surprised that I did get the dialog you showed me. HOWEVER I only get this dialog about 25% of the time when clicking a commit with multiple branches.

Another 25% of the time I instead get a dialog that lets me select between every single branch in the repository -- again useless.

The other 50% of the time Sourcetree randomly selects a branch for me and checks it out.


author: Jack Zylkin
body: Since this is a bug with Sourcetree, can you confirm that someone will either help me fix it on my end, or investigate further?


author: minnsey
body: I believe you created some tickets on <https://jira.atlassian.com> they will be picked up from there.