Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 git, only Master branch listed

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.

like image 811
Vimes Avatar asked Jul 23 '14 20:07

Vimes


People also ask

How do I change a branch from master to another in Visual Studio?

Access the "Source Control" tab on the left side of VSCode. Click on the "three small dots" next to the refresh button. Click on the "Checkout to..." option. Choose the branch you want to switch to.

How can I see all branch codes in Visual Studio?

You can create and checkout branches directly within VS code through the Git: Create Branch and Git: Checkout to commands in the Command Palette (Ctrl+Shift+P). If you run Git: Checkout to, you will see a dropdown list containing all of the branches or tags in the current repository.

Why my branch is Main instead of master?

If you create a new repo both locally and at GitHub, the default branch name in the local repo might be master while the default branch name at GitHub might be main . This is a potential mismatch. But it's really not a problem, because you can just change the branch name at either end (or both ends, if you like).


1 Answers

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.

like image 174
Edward Thomson Avatar answered Oct 20 '22 05:10

Edward Thomson