Powershell在每次拉动而不是在启动时都要求使用git RSA密码?

Cal*_*res 7 git powershell posh-git

我已经安装了PoshGit并且我已经使用github和我的〜\ .ssh文件夹设置了我的RSA密钥,但PowerShell仍然提示我在每次拉/推时输入密码.我按照这里给出的所有说明进行了操作.我的powershell配置文件如下所示:

$env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
. 'C:\Users\Caleb\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
cd ~\Documents\GitHub\travefy
Run Code Online (Sandbox Code Playgroud)

这是发生了什么.我怎么才能让它在启动时问我?

在此输入图像描述

Cal*_*res 5

事实证明我需要运行

> ssh-add
Run Code Online (Sandbox Code Playgroud)

我不确定为什么在github.com上的任何文档中都没有提到这一点.

  • 我意识到这是旧的,但我遇到了同样的问题,而且与`ssh-add`无关.事实上,我可以验证我的ssh密钥正在使用ssh和ssh-agent.`ssh -T git @ github.com`按预期工作,`ssh-add -l`显示我的密钥已加载.但是`git pull`每次都会提示输入密钥.我很难过. (2认同)

pas*_*lre 5

您可能需要通过在 Powershell 中发出以下命令来配置 Git 以使用 OpenSSH 的 Windows 10 实现:

git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
Run Code Online (Sandbox Code Playgroud)

这对我有用。资料来源:danieldogeanu