使用TortoiseGit拉取一个项目时,提示:git
Disconnected:No supported authentication methods available(server sent:publickey)github
或是ssh
Please make sure you have the correct access rights
and the repository exists.测试
可是发现若是直接用git命令却能够拉取成功。server
因此能够肯定是TortoiseGit有问题,Git没有问题,生成的ssh密钥也没有问题blog
找了下git的ssh.exe文件it
经过如下方法能够修复TortoiseGitio
修改ssh client的路径后,能够正常使用TortoiseGitclass
附上git配置命令:email
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ ssh-keygen -t rsa -C “johndoe@example.com”
按3个回车,密码为空。
在github上添加ssh密钥,这要添加的是C:\Users\johndoc\.ssh目录下 “id_rsa.pub”里面的公钥。
测试:ssh git@github.com