8

I'm currently working on .Net projects that are using either Git or Mercurial (Hg) source controls. I use Visual Studio 2010 for all of these projects. As I often have to switch source control providers I was wondering if there's a quick way to do this, so I don't have to go Tools -> Options -> Source Control once an hour.

A much better solution would be if Visual Studio would recognize which source control provider it needs or maybe remember which provider was used for a certain project. Can that be done?

gligoran
  • 3,267
  • 3
  • 32
  • 47
  • possible duplicate of [How to configure Visual Studio to use diferent source control providers](http://stackoverflow.com/questions/5994009/how-to-configure-visual-studio-to-use-diferent-source-control-providers) – Joel B Fant Jul 13 '11 at 15:26
  • 1
    Read both answers, including the other Q&A that is linked in one of them. **:)** – Joel B Fant Jul 13 '11 at 15:27
  • @Joel: You're link helped me search in the right direction. Thanks. – gligoran Jul 21 '11 at 16:25

2 Answers2

3

With a nudge in the right direction I managed to handle this problem even better then expected - no switching necessary.

For Mercurial solutions I use VisualHG and for Git I use Git Source Control Provider. I also installed HgSccPackage. Now I don't really know how or why this works, but I've got GitSCC selected as the Source Control Provider in the settings, but when I load a Mercurial project VisualHG takes over. All I have to do is set the SCC to VisualHG the first time I open the project, close the project, change back to GitSCC and when the project is reloaded VisualHG will be used for it.

Interestingly it does not work without HgSccPackage installed. If someone can explain this, please do.

Note that it does not seem to work the other way round.

gligoran
  • 3,267
  • 3
  • 32
  • 47
1

I use Git in combination with VS 2010 by keeping a commandline screen open. I do my work in Visual Studio and when I'm ready to make a commit, I switch to the commandline screen.

If you do this, you can use Git and Mercurial side by side in combination with VS 2010.

Sardaukar
  • 29,034
  • 5
  • 26
  • 32
  • 1
    That's actually less practical then switching SCCs in Visual Studio via Tools -> Options -> Source Control. – gligoran Jul 21 '11 at 16:24
  • Why? I only have to switch to my CLI, do 'git add', 'git commit' and I can switch back to programming. If the solution is hosted in Mercurial, I do the same but use the 'hg' commands. Creating a commit is a separate process from programming. – Sardaukar Jul 21 '11 at 17:04
  • That's perfectly fine if you have one instance of VS open, I usually have more. I would then have to open mutiple CLIs or have to go running around with cd and alike. This would be a great idea if VS had a built in CLI. – gligoran Jul 22 '11 at 09:05
  • Hmmm. I use NConsole as a CLI-replacement which gives me multiple tabbed CLI-windows. But I usually only work in one instance of Visual Studio. – Sardaukar Jul 22 '11 at 09:19