我在 Windows PC 上安装了 mysysgit 和 TortoiseGit,它连接到 Linux 机器上的远程 Git 存储库。我已经创建了 ssh key ,并将它们添加到 TortoiseGit 中的配置文件中。当我与 TortoiseGit 中的远程存储库交互时,一切正常。没有密码提示。但是,当我尝试从命令行运行 Git 命令时,系统会提示我输入 SSH 密码。
我需要做什么才能不提示我从命令行输入密码?
最佳答案
确保您的 git session 引用 TortoisePLink.exe
(在 GIT_SSH 环境变量中),如“Why git can't remember my passphrase under Windows ”中所述:
(您可能已经完成了前两个步骤)
- 使用 TortoiseGit 的
puttygen.exe
转换您的 key ,以便与 TortoiseGit 的pageant.exe
一起使用。 - 运行 TortoiseGit 的
pageant.exe
,打开.ppk
文件(“添加 key ”),并提供 key 的密码。 添加环境变量:
GIT_SSH=C:\full\path\to\TortoisePlink.exe
这假设您的 TortoiseGit is using TortoisePlink.exe
.
OP scott80109结论in the comments :
msysgit was installed to use Open SSH.
I changed it to useplink
, and it now works without a prompt
Erez A. Korn添加in the comments :
I prefer to use openssh as it doesn't require me to have my key in an alternative format (ppk).
I've written a small wrapper to launch thessh-agent
and take care of business and then added it to my Windows Startup.
You can check the code inerezak/ssh-agent-wrapper-win
.
关于linux - Windows命令行GIT密码提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18993630/