Use Git commandline directly from Visual Studio


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("") | iex
Import-Module PsGet
Install-Module Posh-Git –force

Now you have command completion inside Visual Studio. Nice!

Search This Blog


Most Reading