Commit with TortoiseGit / TortoiseSVN directly von VisualStudio

Albert Weinert has written a nice post about integration the git command line interface to Visual Studio without an additional plugin. After reading this i though about it a while. In both TortoiseGit and TortoiseSVN you can do all the common operations directly from commit window. So the best way should be to open the commit window directly with a shortcut in Visual Studio.

And here is how to do it.

Open Tools->External Tools

 image

Add an new entry. For the command go to your Tortoise installation directory and assign the TortoiseProc.exe . The arguments have to be “/path:”$(SolutionDir)” /command:commit”. This assumes that your *.sln file lives directly in you project root. Otherwise you can not commit changes the was made outside of you source directory. To fix this you could add an ..\ after the $(SolutionDir) variable.

After this you can open the commit window directly from your Visuel Studio tools menu. To assign a keyboard shortcut to it, you have to count the entry in your External Tools list. In my case the entry is at position 3.

So open Tools->Option. Go to Environment Keyboard.

image

Now you need to search for the Tools.ExternalCommand3 (where 3 is the number where your tool is). Now you can assign a keyboard shortcut for it.

I prefer Ctrl+C, Ctrl+G for TortoiseGit and Ctrl+C, Ctrl+S for TortoiseSVN.