How to specify the source control plugin on a per-

2020-02-26 03:02发布

问题:

I just installed AnkhSVN to have subversion support from within Visual Studio 2010. I noticed I had to go to Tools > Options > Source Control to select the current source control plugin.

At the moment, I'm working on multiple projects using different version control systems. For instance, I also have some projects in Mercurial, for which a VS source control plugin is available.

Is there any way to specify the source control plugin on a per-solution basis? Or can VS detect the used vcs automatically? What are the best practices in this respect?

Edit: a google search led me to How to configure Visual Studio to use different source control providers and Can Perforce and SourceSafe co-exist in Visual Studio?. Both cover the same ground, but appear to be specific to specific vcs and lack a satisfying general answer. I'm looking for a general answer here.

回答1:

There is unfortunately no good answer here. You will simply have to go in and manually change you visual studio source control provider settings before you open the project. This is a limitation of how this particular plugin system works, and will probably take a new version of visual studio to specifically address it.

This is an instance where visual studio works better for the enterprise shop with standardized source control tools, and not as good for a contractor working with multiple clients across an array of technologies.



回答2:

Source control provider auto switching based on reserved directory presence can be done with a VS extension as described here.