Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell/PoshGit - 'Could not find ssh-agent'

Tags:

git

powershell

I have installed Git version Git-1.8.3-preview20130601.exe from https://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git. I have also installed PoshGit and I am using Windows PowerShell.

When I start up PowerShell I get

WARNING: Could not find ssh-agent

I am able to enter ssh-agent.exe into the command line and the ssh agent starts up. I'm also able to do all of the Git commands, so my path to Git is probably correct.

I have been following this guide to get Git working correctly in Windows.

I have already tried his suggestion of adding $env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin" into my Microsoft.PowerShell_profile.ps1 file and it did not work. It did not make any difference. I am looking for suggestions other than that solution.


For completeness, this is my Microsoft.PowerShell_profile.ps1 file

# Load posh-git example profile
. 'C:\Users\________\code\posh-git\profile.example.ps1'
$env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
like image 762
arb Avatar asked Jul 05 '13 12:07

arb


1 Answers

You just need to reverse those two lines in your Microsoft.PowerShell_profile.ps1 so that the PATH environment variable is updated to include the Git bin path before you include the posh-git profile.

On my PC this is what it looks like: I start PowerShell and get the warning message:

WARNING: Could not find ssh-agent

I locate and edit the PowerShell profile using $profile:

C:\Users\glombard> notepad $profile

Update the $env:path to include the path to git before loading the posh-git example profile:

$env:path += ";${env:ProgramFiles(x86)}\Git\bin"

# Load posh-git example profile
. 'C:\tools\poshgit\dahlbyk-posh-git-22f4e77\profile.example.ps1'
like image 182
G. Lombard Avatar answered Sep 19 '22 17:09

G. Lombard