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?
I'm running Visual Studio 2013 Update 2.
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.
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.
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).
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:
Once you've done that, this will appear as a "published branch" allowing you to push and pull to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With