这个是windows下的,linux解决方案也类似,就是找到ssh的配置位置即可
输入下面的代码测试
ssh -T git@github.com
出现以下错误:
ssh: connect to host github.com port 22: Connection timed out
Please make sure you have the correct access rights
and the repository exists.
解决措施:
打开“显示隐藏的项目”
在C:/Users/<用户名>/.ssh/ 下,新建“config”,没有后缀
输入以下内容:
Host github.com
User YourEmail(你的邮箱)
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
然后再次输入:ssh -T git@github.com,根据提示操作即可。
然后再次输入:ssh -T git@github.com,会提示成功!