SSH 能秘钥登录,但是 Git 却不能

SSH 能秘钥登录,但是 Git 却不能
SSH 配置了且能秘钥登录,但是git提交代码要密码
排查问题流程
- 重新配置公钥私钥
- ssh-agent 管理
1. 2.
都试过了,有没有可能是命令本身的问题?
找到这篇文章:https://github.com/orgs/community/discussions/28961#discussioncomment-3363250
大致是说:git 命令可能不是用的 windows 的 ssh,git 命令需要指定 windows 的 ssh 才会去用里面的私钥
总结
1 | git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe |