Installing GitHub for Windows is a nice way to get at once beginner\'s git Windows app, msysgit and posh-git - but you can only start the git shell with posh-git by calling \"Gi
From http://haacked.com/archive/2012/05/21/introducing-github-for-windows.aspx, put this in your profile to load posh-git from GitHub for Windows:
# If Posh-Git environment is defined, load it.
if (test-path env:posh_git) {
. $env:posh_git
}
Following these directions, to install and use Posh-git in powershell do the following:
git clone git://github.com/dahlbyk/posh-git.git
to your choice of directorySet-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy Unrestricted
cd posh-git
.\install.ps1
. $PROFILE
I originally followed directions given in the popular haacked.com tutorial (as pointed out by @dahlbyk and @CB) but had similar issues as the OP.
Though @dahlbyk answer did not provide resolution, it still pushed me in the right direction. The problem is, $env:posh-git environment referenced in the Phil's Haack blog post is not defined, so testing it in the PowerShell profile script does nothing.
What works though is running shell.ps1 and profile.example.ps1 from the same script. Here is the recipe for PowerShell noobs like me:
Add the following 2 lines:
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. $env:github_posh_git\profile.example.ps1