7

Work uses SVN. I want to use GIT for private use. I was also exploring TFS, but it doesn't seem to cooperate with multiple collections, so I stopped looking into it.

Currently I use AnkhSVN. I want to switch between it and the Microsoft GIT, on a per-solution basis.

My question is... how do you smoothly use SVN on one project, git on the next, maybe even TFS on a third project (if I decide to look into it again)? Mercurial? etc

How do you manage switching between those stacks easily in Visual Studio, because it doesn't seem like it's made for easy transition between technologies or configuring Solution A for SVN and Solution B for GIT.

The only way I know is to use options and switch manually between technology stacks.

Options: Source Control Options: Source Control

  • I am almost postive Visual Studio has add-ons for both SVN and GIT. That would be the best way. – Ramhound May 7 '14 at 17:52
  • @Ramhound VS comes with TFS & GIT built in. And I use AnkhSVN for SVN integration. But to switch, as far as I know, involves tools > options > Source Control > Switch. So it's VS wide. My question is how does someone work inside VS if they have different source controls to work in. – WernerCD May 7 '14 at 17:55
  • VS2013 does previous versions required a plugin. What is the problem with switching your source control? Your case is an edge case most people don't put projects under different source control under a single visual studio solution. In the future you should indicate within the question body itself the version of the software. Most people don't use tags properly so 99% of the time I don't even bother looking at the tags. – Ramhound May 7 '14 at 18:05
  • @Ramhound OP says he wants to use Git in ONE SOLUTION and subversion in ANOTHER SOLUTION. What is weird with that? I'm f***ing surprised it can't be configured per-solution o.o – Áxel Costas Pena Oct 22 '14 at 14:17
  • @ÁxelCostasPena very professional response you made there... – Ramhound Oct 22 '14 at 15:21
3

Git also has the ability to push to a subversion repository and pull from that repository so you could continue using git on all you projects and still use the SVN repositories when that is the projects source control.

The commands for it are all referenced with git-svn.

I found a pretty good tutorial about it.

http://viget.com/extend/effectively-using-git-with-subversion

  • 1
    Does this work within Visual Studio, or would that have to be command-line? I'm not averse to command-line but I am wanting to start inside of VS first. – WernerCD May 7 '14 at 18:10
  • I think you may have to do only once "git remote add" to your SVN repository and then VS will start smoothly. I haven't tried this yet. – usr-local-ΕΨΗΕΛΩΝ Jan 12 '15 at 12:39
1

While this doesn't address easy plugin switching, if you're comfortable using GIT via command line (as all the cool cats recommend), the Package Manager console window is just a Powershell prompt, so you have access to git *whatever* without switching source control providers.

You can also set up a custom 'External Tool' to open up a command-line prompt (or other shell) targeting the solution directory, so you can call normal git commands. Mapping it to a hotkey like CTRL+~ makes it easier to pull up.

You can also install the "Open Command Prompt" extension which does the same thing, and has some config options to make it a little easier than the external tool. Change the default hotkey from ALT+SPACE via 'DebuggerContextMenus.ScriptProject.OpenCommandLine.Default' (or the others listed).

Sidenote: if you do use git via commandline, consider setting up some convenience aliases...

  • It's too bad git in powershell doesn't do the nice color coding you see in git bash. The color coding improves the usability of git command line quite a bit, IMO. – Darryl Jul 5 '17 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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