Source Control SwitcherAutomatically activates the right source control provider in Visual Studio for every solution you open. WhyVisual Studio can have only one source control provider active at a time, and it does not choose one per repository. If you work with Git in one solution and Subversion, TFVC or Perforce in another, you end up changing Tools > Options > Source Control > Plug-in Selection by hand every time. Source Control Switcher does it for you: when a solution or folder opens, it detects which kind of repository it belongs to and activates the matching provider. Supported repositories
Works with solutions ( Requirements
Still on Visual Studio 2015–2019? Use version 1.1.2. InstallationIn Visual Studio: Extensions > Manage Extensions, search for Source Control Switcher, install and restart. Alternatively, download it from the Visual Studio Marketplace or from the GitHub releases. That's it: there is nothing to configure for the common cases. How it worksWhen a solution or folder opens, the extension looks for repository markers starting from the solution folder and moving up to the drive root. The nearest marker wins; at each folder level the order is:
If nothing is found and Perforce detection is enabled, it asks the Perforce client in the background; if you pick a provider by hand while it runs, your choice is kept. When a repository is found, the provider configured for it is activated; when nothing is found, the current provider is left unchanged. Every switch is logged in the Source Control Switcher pane of the Output window:
OptionsTools > Options > Source Control Switcher > General
CommandTools > Detect Source Control Provider runs the detection again for the open solution or folder and activates the matching provider. Use it after changing the provider by hand, or to switch on demand with automatic switching turned off. Custom providersFor a source control client the extension does not know, add a rule mapping a marker to the client's provider GUID, for example:
When TroubleshootingSet Logging to Verbose and open View > Output, then pick Source Control Switcher in the
Show output from list: every detection step and its outcome is logged there. Messages are also written to the
Visual Studio activity log when Visual Studio is started with Found a bug or have an idea? Open an issue. Building from sourceOpen CreditsBased on SccAutoSwitcher by Francesco Pretto. Thanks to everyone who contributed fixes and ideas, including @QianMoXi (start-up with a solution), @joe-kr (Visual Studio 2022 support, AnkhSVN 2019) and @davideciarmiello (TFVC support). LicenseMIT — see also the official page on ryadel.com. |

