Reputation: 358
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?
Upvotes: 11
Views: 6063
Reputation: 71
I fixed this issue by deleting the system protected folder named like .git where the project is mapped on local drive. If you cant see the folder on the mapped location go to view -> options -> change folder and search options -> view , and then check 'show Hidden files and folders. Now restart the VS
Upvotes: 0
Reputation: 852
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
Upvotes: 14
Reputation: 11
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.
Upvotes: 1
Reputation: 56
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.
Upvotes: 1
Reputation: 31013
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.
Upvotes: 6