98
votes

I'm using Visual Studio 2013's Git support to work on a private GitHub repository. I have permission to commit to it. I want to switch branches, but when I go to the Branches view, the only branch in any of the lists (branch drop-down, published branches, merge tool) is master. Other branches show up in GitHub, GitHub for Windows, and TortoiseGit. So I know they're there and I have access.

Any ideas why I can't see other branches in Visual Studio?

enter image description here

I'm running Visual Studio 2013 Update 2.

1
Visual Studio does not show remote branches in the branches drop-down. Make sure that you have created a local branch - by doing so, it will set this up to correspond to the remote branch. (Which is to say, it will appear in "published branches"). If you have done that, can you post your .git/config from that repository? - Edward Thomson
Ah, that was it! Post as an answer and I'll mark it. Thanks! - Vimes
do a Fetch/Pull on the master first prior of creating a local branch and you should be able to see the remote branches in the drop down list origin\branchname according to the image bellow i'm using VS2013 Update 5 - Nerdroid

1 Answers

151
votes

The branch dropdown will only show local branches, it will not show remote branches. You should create a new local branch to track that remote branch. Simply click the New Branch dropdown, and you will see all the remote branches:

enter image description here

Once you've done that, this will appear as a "published branch" allowing you to push and pull to it.