gpt4 book ai didi

Powershell 中的 Git 说 'Could not find ssh-agent'

转载 作者:IT王子 更新时间:2023-10-29 01:24:21 24 4
gpt4 key购买 nike

我安装了 git,它在命令提示符下运行良好,但是当我打开 powershell 时,它会给我这个警告:

WARNING: Could not find ssh-agent

我正在运行选美并加载了我的私钥。这适用于所有 gui 工具和命令提示符,但不适用于 Powershell。

这是怎么回事?

最佳答案

对于那些寻找详细解释的人,请阅读 this blog post .以下是博客文章中的引述。最终 ssh-agent.exe 需要在路径中,或者以其他方式解析。

编辑:看来大多数人都懒得阅读链接的博客,原始摘录也没有引用完整的解决方案,所以我从下面的博客中扩展了引文。

根据对所有其他答案的喜好,有多种方法可以解决错误。下面引用了一个已知的工作。扫描其他答案,它们可能更适合您。

When I restarted my PowerShell prompt, it told me it could not start SSH Agent.

It turns out that it was not able to find the “ssh-agent.exe” executable. That file is located in C:\Program Files (x86)\Git\bin. but that folder isn’t automatically added to your PATH by msysgit.

If you don’t want to add this path to your system PATH, you can update your PowerShell profile script so it only applies to your PowerShell session. Here’s the change I made.

$env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"

On my machine that script is at:C:\Users\Haacked\Documents\WindowsPowerShell\Microsoft.Powershell_profile.ps1

关于Powershell 中的 Git 说 'Could not find ssh-agent',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7470385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com