23

Is there a way in Visual Studio 2017 to unbind a solution or project from source control? I can only find answers to this question for older versions which suggest going into File > Source Control however it appears the Source Control option has been removed in this version.

For older versions:

2010,2008,2005

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
Cassova
  • 530
  • 1
  • 3
  • 20
  • Git has nothing to do with Visual Studio. You don't *bind* the project with git. If the folder contains a `.git` folder, it *is* a git repository – Panagiotis Kanavos Sep 01 '17 at 07:44
  • 5
    The question speaks for itself. Because the project is no longer going to be in source control. Why are you downvoting something you don't understand? – Cassova Sep 01 '17 at 17:11
  • For example, if you want to send a project folder to a client, you can use [git archive](https://git-scm.com/docs/git-archive) to create a zip with the files without the `.git` subfolder. You can also use `git clone --depth=1` to only the latest version of a repo. – Panagiotis Kanavos Sep 04 '17 at 07:41
  • 1
    In my case, I came here because I attempted to add a new project to Team Services and the IDE assumed I wanted a GIT repro, no questions or confirmation asked. – Sea Charp Sep 13 '18 at 13:49
  • no, this would make life enjoyable and the goal of visual studio and TFS is to make life miserable – CervEd Oct 06 '20 at 13:17

4 Answers4

25

In VS2017 (checked in versions 15.8.9 & 15.9.10) and VS2019 (16.5.4) and VS2022 (17.1.3), goto:

Tools / Options / Source Control / Plug-in Selection

In combo-box "Current source control plug-in:", change to "None" and click OK.

The project will close; just reopen it and that's all...

enter image description here

To reach the Plug-in Selection section in Options, you can also use the search box; just type "Plug-in" and click in "Source control -> Plug-in Selection". In combo-box "Current source control plug-in:", change to "None" and click OK.

enter image description here

Ignotus
  • 564
  • 5
  • 17
10

just remove all .git base files from project root folder and sub folder, after that restart solution and project you will get git free project

Naimish Mungara
  • 213
  • 1
  • 4
  • 14
6

In Visual Studio 2017, open a connected project or solution then select:

  1. File
  2. Source Control
  3. Advanced
  4. Change Source Control
  5. Click Unbind on the project or solution of your choice.
DSLuminary
  • 171
  • 1
  • 4
  • 5
    In VS 15.7.2 there is no Source Control item on the File menu, at least on my setup. Do you have a screen shot you can add? – InteXX Jun 22 '18 at 01:46
  • 1
    Worked for me. I'm using VS Professional 2017, version 15.9.6 – R.D. Alkire Feb 11 '19 at 21:25
  • 4
    Note that VS 2017 will only show the source control option under the file menu if the loaded solution is using a TFVC repository. In the case of the asked question, it would not show up because it is using a git repository. – Rootberg Feb 14 '19 at 20:56
3

It seems the only way to do this is manually removing files. This answer worked for me:

Remove .git* files and folders

Cassova
  • 530
  • 1
  • 3
  • 20
  • Because Visual Studio has nothing to do with git. You didn't "unbind" the project from source control. You deleted the repository itself. The `.git` folder *is* the repository. – Panagiotis Kanavos Sep 01 '17 at 07:44
  • BTW why? This is an extremely bad idea. If you encountered a problem with git, solve it. Git isn't broken. Without it you *will* lose files and changes. The way the universe works, by next Tuesday – Panagiotis Kanavos Sep 01 '17 at 07:46
  • 6
    Thanks. I accidentally added my project to git, when I meant to add it to TFS. – Jack Nov 06 '17 at 14:22
  • it seems the git team thinks they are more important than the other source control providers – Matthew Whited Jan 17 '20 at 16:55