30

I create a new branch in remote GIT repository. Repository stored on BitBucket.

In my my local repository I can see this new branch with SourceTree. It appears in commits list, on same commit I create branch from. But I cannot see this new branch under branches list and cannot checkout it.

I want to checkout and push updated on my local workstation code to remote repository back, but within exactly this new branch. I started development on same branch, what was source to clone new branch.

I tried to pull this new branch. It is empty as it should, but it still not under branches list and I cannot checkout it.

How to commit to this new branch?

P_M
  • 2,723
  • 4
  • 29
  • 62

1 Answers1

62

With SourceTree (1.9.6.1) alone (not talking about the command-line here), make sure:

  • you have fetched the repo
  • your log view is set to "All Branches" (not "current branches")
  • "Show Remote Branches" is selected

Note: the BRANCHES section at the left side of the log view only display local branches, not the remote ones.
The remote branches are list in the REMOTES/origin section, just below BRANCHES and TAGS.

By double-clicking on the remote branch, you can create a new local branch.

checkout new branch from remote tracking branch

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2
    Looks like this should help. I have no idea about remote branches are under origin, so was not able to checkout any of them. Thanks. – P_M Oct 26 '16 at 12:50
  • Looks like this is no longer there in SourceTree v2 –  Jun 08 '18 at 07:55
  • 1
    @K48 I am with SourceTree 2.5.5 very latest edition (June 2018) and I see exactly what I described in the answer (when double-clicking on a remote branch which is *not* the one currently checked out) – VonC Jun 08 '18 at 19:37
  • Note to self: this is my 400th Guru badge. – VonC Jul 03 '19 at 07:51
  • finally an explanation of this in Sourcetree, thanks! – Fattie Mar 20 '20 at 09:47
  • 3
    While I found that you COULD do this on REMOTES > origin I found that REMOTES > origin (scroll through hundreds/thousands of branches to find the one I want to check out) to be a more than a bit painful - I could see no way to "type and filter somehow:" using the UI there. (vers 3.3.8) – Mark Schultheiss Aug 27 '21 at 18:04
  • When I try to Check Out in Sourcetree from our bitbucket server Sourcetree just crashes – Mark Schultheiss Aug 27 '21 at 18:06
  • @MarkSchultheiss I suspect you would need to change the local repo [refspec](https://stackoverflow.com/q/44333437/6309 in order to [fetch *less* branches](https://stackoverflow.com/q/20450003/6309, making the remote selection and subsequent checkout possible. – VonC Aug 27 '21 at 18:39