环境:windows系统
错误信息如下:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
原因:
私钥不对。
解决办法:
1. 如果是在Git命令行下出现的,则在C:\Users\用户名\.ssh这个目录下,放入openSSH私钥。
2. 如果是TortoiseGit客户端,并且要使用PuTTY密钥,则使用开始菜单TortoiseGit文件夹里的PuTTYgen工具,将openSSH私钥转换成PuTTY私钥,在TortoiseGit客户端配置好PuTTY私钥的位置即可。(配置PuTTY私钥步骤:在项目根目录,鼠标右键->TortoiseGit->设置->Git->远端->选择Origin->PuTTY密钥,选择ppk后缀的密钥文件。)
关于如何生成openSSH密钥,这又是一个技术点,请网上找文章吧!