linux - Windows命令行GIT密码提示

标签 linux windows git ssh ssh-keys

我在 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 use plink, 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 the ssh-agent and take care of business and then added it to my Windows Startup.
You can check the code in erezak/ssh-agent-wrapper-win.

关于linux - Windows命令行GIT密码提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18993630/

相关文章:

c++ - 为什么在不同的连接(新的 InternetOpen 和新的 InternetConnect)上两次调用 HttpSendRequest 会带来不同的结果?

Linux内核sendpage函数

r - R 脚本中的 SSH 获取 MySQL 数据库

php - 使用 PHP 代码在 Linux 服务器上创建目录时出错

git - merge 到分支,你 merge 到哪一个并不重要?

带有 <pattern> 的 git for-each-ref 不返回任何内容

git - 在 IntelliJ 中以图形方式显示等同于 git log --follow

linux - 与 Rundeck 中的用户混淆

windows - 无需锁定的优雅文件读取

linux - Linux 中的 cakephp 热插拔驱动程序是否与 Windows 中的设备禁用/启用功能相同?