Win环境Git小乌龟报错

TortoiseGit的使用

Posted by Duu on February 6, 2024

出错信息

报错:fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

image.png

本质原因

尝试使用 git bash ssh -T git@github.com命令后报错:

ssh: connect to host github.com port 22: Connection timed out

解决方案

在C:\Users\Administrator.ssh 下加入 config 文件(无后缀)内容:

Host github.com
User 472287500@qq.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443