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

Jack Zylkin February 6, 2019

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

 

1 answer

0 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2019

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.

Jack Zylkin February 7, 2019

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.

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2019

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

The BRANCHES heading shows you only  branches you have already checked out locally.

Jack Zylkin February 7, 2019

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. 

Jack Zylkin February 28, 2019

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. 

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2019

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

Jack Zylkin March 1, 2019

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.

Jack Zylkin March 1, 2019

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.

Jack Zylkin March 5, 2019

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

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2019

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events