Git in Powershell saying 'Could not find ssh-agent'

前端 未结 6 1289
离开以前
离开以前 2021-01-30 06:26

I have git installed and it works great in the command prompt, but when I open up powershell it gives me this warning:

WARNING: Could not find ssh-agent
<         


        
6条回答
  •  暖寄归人
    2021-01-30 06:39

    You can add two lines to the top of your profile (type ise $profile) to fix this PoshGit issue without polluting your Path. Then run . $profile to reload your profile.

    For 32-bit git

    Set-Alias ssh-agent "${env:ProgramFiles(x86)}\git\bin\ssh-agent.exe"
    Set-Alias ssh-add "${env:ProgramFiles(x86)}\git\bin\ssh-add.exe"
    

    For 64-bit git

    Set-Alias ssh-agent "$env:ProgramFiles\git\usr\bin\ssh-agent.exe"
    Set-Alias ssh-add "$env:ProgramFiles\git\usr\bin\ssh-add.exe"
    

提交回复
热议问题