Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

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
You can’t perform that action at this time.