今天一下午被Github整了
开始报错的是
fatal:unable to access ‘…github.com/…/.git’:Failed to connect to github.com port 443: Timed out
后来锲而不舍的push又变成下面这个问题:
$ git push origin master
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of know n hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
之前一直都能用,只是突然这次就总是连不上
还试了一下这个ssh -T git@github.com
后来发现是自己没有添加 SSH key,自己有生成但是没有添加到GitHub,所以马上添加了,再push一次就好了
毕竟新手,在网上看了很多人的解答让我还是摸不着头脑,抱着试一试的心态居然就成功了。。不过还是不理解为什么之前push都成功了,怕自己是碰运气push上了,于是又查了一下ssh -T git@github.com
这样看起来问题完美解决了!
希望能帮助您!