Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 will only use git for source control

I have always been able to create a project/solution and add it to source control and it will get added to TFS. In the last couple of months something has changed and when I create a new project/solution in Visual Studio 2015 Enterprise, it automatically uses git, even though the source control plugin is set to TFS. I have tried Tool>Options>Source Control and set the plugin back to TFS(VS resets this to git), closed Visual Studio, reopened and the plugin is still set to TFS until I add a project/solution to source control.

If I create a new project and add it to source control, I get no prompts, it immediately uses git(even though set to TFS). When I go back and look at the Source Control plugin it has been set to git by vs.

We don't use git, source control is TFS2010. Is there anyway of making VS it give me a choice of source control, or just assign it to only use TFS?

like image 497
Damian70 Avatar asked Jun 01 '16 14:06

Damian70


People also ask

How do I add Source Control in Visual Studio 2015?

In the Team Explorer window, expand your team project, and then double-click Source Control. On the Source Control Explorer tab, click Not mapped. In the Map dialog box, in the Local folder box, browse to (or create) a local folder to act as the root folder for the team project, and then click Map.


4 Answers

A colleague of mine faced the same issue. He didn't check the "Add to Source Control" box when he initially create the project. Choosing "Add solution to source control" from the right click context menu in solution explorer adds the project to the local git repository. The solution was

  1. Tools -> Options -> Source Control tab -> Choose None in the plugin selection. (It may close the solution).
  2. Again Tools -> Options -> Source Control tab -> Choose VS TFS in plugin selection.
  3. Go to the root folder of your project and Delete the Git folder (It may be hidden - may need to show it first).
  4. In Visual Studio connect to a TFS team project.
  5. Try adding the solution to source control -> this should display the TFS dialogue.
like image 65
Yoky Avatar answered Nov 02 '22 23:11

Yoky


Assuming you select Add to Source Control when you create projects. Try to connect to a TFS team project in Team Explorer before creating new projects.

enter image description here

like image 24
Cece Dong - MSFT Avatar answered Nov 03 '22 01:11

Cece Dong - MSFT


I recently had this exact issue and it was to do with my connections. From within the Team Explorer tab, click on the green plug to go to connections. Click on the blue 'Manage Connections' link and choose 'Connect to Team Project'. Choose your TFS server if necessary, ensure that your new project is selected in the right hand pane, then click 'Connect'.

Make sure that the steps others have highlighted above are done (.git files and folders deleted and Source Control Plugin set to TFS) and you should then be able to just right click on the solution and choose 'Add Solution to Source Control' and you should then be able to bind to TFS.

like image 28
Evolution Rich Avatar answered Nov 03 '22 01:11

Evolution Rich


I had this same issue after an update. I have to change the "plug in selection" to TFS, and then re connect to my TFS instance, for it to stop changing the default to GIT.

like image 35
Dave Avatar answered Nov 03 '22 00:11

Dave