Skip to content

Instantly share code, notes, and snippets.

@bcdady
Created April 26, 2015 15:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bcdady/e3ac78cd27e4dcd82699 to your computer and use it in GitHub Desktop.
Save bcdady/e3ac78cd27e4dcd82699 to your computer and use it in GitHub Desktop.
Import posh-git module to an existing console (non Git Shell)
# Starting a new PowerShell (PS) console on a Windows OS instance that has GitHub client for Windows installed ...
# Find the local instance of git.exe; it's an 'external' dependency for posh-git
Get-ChildItem -Path $env:LocalAppData\GitHub\ -Filter git.exe -Recurse
# Should return at least 1 instance of git.exe
# Select one and add an alias to it
# I choose the one in \bin\ for example:
New-Alias -Name git -Value $env:LOCALAPPDATA\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\git.exe
# I then use tab auto-complete to find the latest posh-git module, as included with the GitHub client for Windows
Import-Module $env:LocalAppData\GitHub\PoshGit_869d4c5159797755bc04749db47b166136e59132\posh-git.psm1
@mdcclxv
Copy link

mdcclxv commented Apr 1, 2018

Any idea how to have "GitHub client for Windows installed" ? Without installing GitHub Desktop. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment