kannappan kannappan - 1 year ago 107
Git Question

Unable to get all branches from Git in Team services

I am using team services git as repository.

I have 3 branches in Git repository.

But when I clone the repository in Visual studio 2015, I am able to clone only the

branch of the repository.

Is there a way so that I can clone all the branches of the repository using visual studio.

I have attached the branch structure and the branch in the VS I am able to see only the

enter image description here

enter image description here

Answer Source

Cloning a repo only creates and checkout one branch (the default one, generally master, linked to the remote tracking branch origin/master)

You should be able to fetch and see the other branches as origin/xxx (see "Visual Studio 2013 - Git - Fetch remote branches")

See also "Connecting to a remote Git branch from Visual Studio" from Esteban Garcia.

before you can see the branches locally, you need to create a local tracking branch for the remote branch. You could do this with command-line:

git branch dev –track origin/dev

You can also do this right from Visual Studio.

First, click on “New Branch”
Then select the remote branch from the drop-down list, this will auto-populate the branch local name.