Tuesday, November 3, 2015

Visual Studio 2013–Git integration–Branches are not visible

Last week I was giving training at a customer. To speed up the exercises, I created each exercise on a different branch in Git and used every commit as a step in the exercise. This made it very easy to walk through the exercise step by step and see how the solution is created. The problem was that inside Visual Studio 2013, people only saw the master branch, but couldn’t see any of the other branches I created(note: in other tools, the branches showed up fine):

image

So what’s the reason?

  I discovered that the branch dropdown in Visual Studio 2013 only shows local branches, remote branches are not shown. To see the remote branch, you first have to create a new local branch to start tracking a remote branch. Click on New Branch and select the remote branch from the list. Once you’ve done that, the remote branch will appear in the branch list and you should be able to pull it.

image

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

image

No comments: