How can I get Posh-Git to launch using 'External Tools' in Visual Studio 2013?

147 views Asked by At

The GitHb client installs Posh-Git as a ClickOnce application with a target of C:\Users\Administrator\AppData\Local\GitHub\GitHub.appref-ms --open-shell. Visual Studio 2013 does not like this when I plug it into the 'External Tools' area. I've tried pulling the arguments out, wrapping in quotes, etc.

The goal is to be in a project and quickly launch Posh-Git in the project directory I'm working in.

2

There are 2 answers

0
BlackjacketMack On BEST ANSWER

1.) Add external tools and point to a batch file. Add the arguments listed below in the image. This assumes that your Git repository is one folder up from a 'Solution' directory.

External Tools

2.) The batch file should have the following contents (Replace 'Administrator' with the appropriate user):

@echo off
echo Starting with switches:  %*
echo.
echo.
C:\Users\Administrator\AppData\Local\GitHub\GitHub.appref-ms %*
0
Todd Ropog On

To simply launch the GitHub for Windows shell, use the following values:

Command: %comspec%

Arguments: /c %localappdata%\GitHub\GitHub.appref-ms --open-shell

However, this will not start the shell in the project directory. I can't find a way to make the GitHub for Windows shell do that. I think it always uses the default clone path. To specify the directory, we need to go directly to PowerShell:

Command: powershell.exe

Arguments: -NoExit cd ""$(SolutionDir)""

If you have either GitHub for Windows or posh-git installed, this should work.