u123
u123

Reputation: 16287

Atlassian SourceTree does not show remote branches?

I am running SourceTree 1.6.11 on windows. I have cloned a Git repository but it does not show my remote branches:

enter image description here

Does SourceTree only show local branches?

It shows all the tags though.

Upvotes: 34

Views: 85208

Answers (13)

jabroni
jabroni

Reputation: 316

If none of these command line options work for you (like they didn't for me), then you need to tick the "Show Remote Branches" box above the graph:

enter image description here

This made it work for me.

Upvotes: 0

Niels Gjeding Olsen
Niels Gjeding Olsen

Reputation: 289

My issue was I didn't see the little checkbox "Show Remote Branches" in top bar in SourceTree :-)

Upvotes: 0

Muhammad Bilal
Muhammad Bilal

Reputation: 1152

I have tried different things like upgraded the source tree, restart , clear cache and all other things. does not work for me. However Following step solved my problem. It is look like source tree bug which is already reported multiple times.

  • Open Terminal from Source Tree
  • write following command with your current branch name
  • git push --set-upstream origin #BRANCHNAME

Upvotes: 0

Madhawa Priyashantha
Madhawa Priyashantha

Reputation: 9872

I had the same issue .refresh didn't work.so i manually fetch from the remote

Just run this command and restart sourcetree

git fetch --all

Upvotes: 7

David Bridge
David Bridge

Reputation: 888

This is an old post but I thought as I got here, others may too I had this issue in 1.6.2 Source tree (in Oct 2015) and my new remote made on another machine 5 days ago was not showing up in Source Tree on my work machine. I can see my remote branch with command line and in BitBucket web site but not in SourceTree.

Anyway, after ten minutes of doing nothing my remote branch showed up.

I then found in options that there is a setting for refreshing remotes which not surprisingly was set to 10 minute intervals.

On top of this it is possible to refresh immediately with ALT+SHIFT+R

Hope this helps someone.

Dave

Upvotes: 12

jan2705170
jan2705170

Reputation: 253

I ran into this and none of the solutions here worked for me. What did work was in my SourceTree repository, press the Settings button to get the Repository Settings dialog. Then press the Edit Config File button and open the config file. Then changed the fetch line under [remote "origin"] to this, saved the file, fetched and the remote branches then showed up. Before:

fetch = +refs/heads/master:refs/remotes/origin/master

After:

fetch = +refs/heads/*:refs/remotes/origin/*

Upvotes: 16

Nick Gorman
Nick Gorman

Reputation: 11

I tried a few of the above examples with no luck so here is what I did. In BitBucket, go to the branch you want to check out and press the beautiful blue "Checkout in SourceTree" button.

Next I went to SourceTree and instead of clicking Branches, which one would think being a newbie, click remotes on the left side. Open up your tree views until you find the branch you want to access and double click. A dialog should pop up to create a new branch, Go ahead and press ok. Your BitBucket branch should now be in your local and be showing in the Branch side menu.

If this is completely wrong or the incredibly slow way let me know but it worked when all else didn't.

Upvotes: 0

ryan r
ryan r

Reputation: 11

I had this issue and it turns out the repo I was attempting to push to was not assigned to the team I was given rights to work as a part of. My admin moved the repo to our team and the problem was fixed.

Upvotes: 0

ellcub
ellcub

Reputation: 601

I found this to checkout a remote branch:

Repository > Checkout > Checkout New Branch > Checkout remote branch [select remote branch to checkout]

The branch I selected is now shown in the menu on the left under branches, (although still not in the branches dropdown box along the top)

Hope this helps.

Upvotes: 43

smp7d
smp7d

Reputation: 5032

(This probably is not your issue but it is easy to end up here with certain search queries.)

Make sure you perform a fetch on the remote repo. This may take care of it.

Upvotes: 1

Judy007
Judy007

Reputation: 5860

The solution for me was simple. Simply use the command line, and execute

git branch -r

and

git branch -a

to make sure you have all the remote branches locally, then checkout each branch which is NOT showing in sourcetree. After you check it out, it will display in sourcetree.

For instance, after executing

git checkout develop

your develop branch will display in sourcetree.

Upvotes: 8

Eric McCormick
Eric McCormick

Reputation: 2733

What wound up working for me, after some trial and error, was to:

  • copy the path of my remote
  • remove the remote from my repo settings
  • let my project refresh in SourceTree
  • add the remote back, in repo settings
  • perform a Fetch

The Fetch alone didn't seem to do the trick, in and of itself, for each repository I experienced the issue in (it happened in a small handful, and a Fetch alone did work for some).

Expanded info:

What seems to be at issue here is how the local repository was tracking the remote. For those that a simple Fetch did not resolve the issue, running git branch -r in the repository yielded nothing. After successfully being able to view them, I confirmed the output of git branch -r output the HEAD along with master and develop branches for my remote, as I expected.

Upvotes: 7

flyx
flyx

Reputation: 39678

SourceTree does show remote branches. It seems like your remote repository only has a branch master. Compare the output of git branch -r, which lists all remote branches. Try git fetch if your remote copy is out of sync.

Upvotes: 3

Related Questions