45

Currently the solution is managed by SVN and I want to switch to git. When I do Tools->Options->Source Control->Plug-in Selection and change plug-in I get this dialog:

enter image description here

I never get past that, when I open the .sln again it is still SVN.

I have a feeling I have done this many times in the past.

Additional info: The files are already managed by git, I just cloned it using git extensions and it was np. The issue is in VS.

1
  • Is there a way to do vice versa GIT to SVN ?
    – rinilnath
    Mar 14, 2022 at 7:39

6 Answers 6

72

Suggestion: Don't bother with switching. Remove it from source control (SVN) and check it in anew (git). Or, if removing it by Visual Studio tools doesn't work, here's how you do it manually:

  1. Close Visual Studio;
  2. Delete the .svn folder
  3. Open the .SLN file in notepad, find the lines which specify the SCC provider, and delete them.
  4. Open the solution in Visual Studio again - it should not be under source control anymore and you should be able to check it in git.

Edit: Manually removing this from the .sln file did the trick:

GlobalSection(SubversionScc) = preSolution
    Svn-Managed = True
    Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
5
  • There is a better option for step 2. Instead of deleting all the .svn folders, you can export the sources. With e.g. TortoiseSVN, select the root folder of your solution -> right click -> TortoiseSVN menu -> Export...
    – ffonz
    Dec 1, 2015 at 8:43
  • 2
    There is a better solution for this process. The equivalent of deleting the SCC entry from the .sln file is simply to disconnect from SVN, directly within Visual Studio, as explained in my answer.
    – JotaBe
    Oct 26, 2016 at 16:14
  • This didn't fix it for me, as the Projects were still bind to svn. So you need to apply this to all Projects. Or better check out @JotaBe's answer
    – daniatic
    Jul 11, 2018 at 7:37
  • @daniatic - All the information about bindings is in the .SLN and/or project files. All the information from SVN itself is in the .svn folders. Search and destroy. :) (Also, I haven't worked with VS in a while, perhaps they've added something else)
    – Vilx-
    Jul 11, 2018 at 11:40
  • This answer was very useful to me! I actually added the code that given in this answer to my .SLN file to get it to open using AnkhSVN as the default source control, instead of Perforce P4V which Visual Studio was wrongly auto selecting when opening my SVN source controlled project.
    – tonyb
    Oct 15, 2020 at 10:48
24

The easier way to do it is a two steps process which can be done withput leaving Visual Studio:

  1. Open the menu option File > Source Control > Change Source Control. In the dialog use the Disconnect button.

  2. As described in the question itself, open the menu Tools > Options, and change the Source Control to git. This time it will change it without complaining at all.

4
  • The File > Subversion menu is not in my VS2019. Oct 15, 2021 at 20:46
  • 1
    @GlenLittle It's supposed to read "source control" not "subversion". I fixed that.
    – TylerH
    Jan 6, 2022 at 16:06
  • I dont see any of this menus under File. VS 2019
    – rinilnath
    Mar 14, 2022 at 7:30
  • Under file there is no source control option May 3 at 10:17
1

What actually helped me, I could not find in my Asp.net core solution folder any svn file or .git, but it was in C:\Users\NAME, deleted there .git file, it was HIDDEN. Then in vs automatically source control changed from git to TFVS. however it somehow created in my solution folder git files, deleted once more and it started to work fine.

0

The proper way to remove these settings for SCC providers is File -> Source Control -> Change Source Control. Where AnkhSVN calls the 'Source Control' menu 'Subversion'.

This trick should work for all well behaved SCC providers (VSS, TFS, AnkhSVN, etc. etc.)

3
  • When I encountered the issue, the only way to remove AnkhSVN bindings was to manually clean-up *.sln file.
    – bahrep
    May 6, 2013 at 12:18
  • 1
    I also tried that but it did not work. I had Ankh as plugin for SVN. Don't delete this answer though. May 6, 2013 at 12:48
  • 1
    If you disconnect the .sln file in this dialog this registration in the .sln will be removed when the solution file is saved again. (The change itself will mark the .sln dirty so VS will ask you to save it) May 7, 2013 at 9:18
0

If you have more than one source control is installed and you are trying to switch from one of the option to other forever, go to Extension> Manage Extension> Installed> choose the one that gets selected by default and uninstall. This will set the selected option to none. Now you can select your desired source control.

0
0

JUst find the hidden .git folder in the root of your website and delete it. THen it will allow you to switch the plug-in to TFS without any error

2
  • 1
    Delete .git and switch to TFS? The OP was switching from Subversion to Git. Did you answer the right question? May 4 at 11:18
  • Sorry I meant delete .svn folder May 4 at 11:32

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.