Use Git commandline directly from Visual Studio

Update:

Instead of using the Package Management Console, you can now use The Whack Whack Console, ConEmu Integration or BuiltinCmd for a better interactive console. These can be combined with PoshGit as well.

Not many people seem to know this, but the Visual Studio Package manager is nothing more than a Powershell window inside Visual Studio with a bunch of modules loaded. Which means that you can use it to execute just about any command you'd like.

So if you need to run git commands to stash or squash something, all you need to do is type the command right into that window.

To make your life easier you can even add PoshGit to the Package Manager Console, this will give you command auto-completion. yay!

Install the Git Command Line tools.

Execute the following commands from the package manager console:


Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
Import-Module PsGet
Install-Module Posh-Git –force
. $PROFILE

Now you have command completion inside Visual Studio. Nice!

Leave a comment.