Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell for GitHub setup

I just installed GitHub for windows and for convenience I added entries for the powershell in the context menu in Windows Explorer. The registry commands are:

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit 
C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'

As suggested in shell.ps1 I added ". (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")" to my profile.ps1 to get poshgit and the rest setup within my powershell environment. It is not completely working though. I can see that shell.ps1 was executed (when running "$env:github_posh_git" I see the right value appearing) but when I navigate to a git repo I do not see the enhanced prompt.

What am I missing?

PS: The only version of Powershell I have came with GitHub for windows and even though the folder says "1.0" running

 $psversiontable.psversion

returned

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1
like image 973
Renaud Avatar asked Aug 13 '13 08:08

Renaud


1 Answers

I got an answer from GitHub support:

The enhanced prompt is provided by posh-git [1], and it isn't added when you run the line in shell.ps1. However, it's easy enough to install.

Just cd to C:\Users\Username\AppData\GitHub\PoshGit_* and run the install.ps1 script from PowerShell. It will add it to your PowerShell $profile automatically.

like image 51
Renaud Avatar answered Oct 22 '22 17:10

Renaud