github连接提示解决办法:1,将连接方式从http更换为ssh。注意,github.com后面一定有(冒号):git remote rm origin
git remote add origingit@github.com:username/respository.git
2,生成新的ssh key。这里会提示要不要rewrite,回车 还有提示输入passPhrase,输入空格即可。cd ~/.ssh
ssh-keygen
3,测试一下连接。
ssh -T -v git@github.com不出意外的话这里会报错,最后几行提示信息如下:debug1: Offering RSA public key: yourpath/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key:yourpath/.ssh/id_dsa
debug1: Trying private key:yourpath/.ssh/id_ecdsa
debug1: Trying private key:yourpath/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
提示信息表明路径 yourpath/.ssh下id_rsa文件存在,并且提供public key,然而无法和网站中的ssh-key匹配上。于是程序转而寻找yourpath/.ssh路径下的id_dsa文件,id_ecdsa文件,id_ed25519文件,看它们是不是能提供新的public key。查看一下yourpath/.ssh,会发现下面根本不存在id_dsa,id_ecdsa,id_ed25519文件。 出错的原因其实在于步骤4更新了本地的ssh key,然而网站上的ssh key还为旧值,所以匹配不上,就报错Permission denied (publickey)4,打开c\windows/ssh文件。5,打开https://github.com/settings/profile,在SSH key那栏选择New SSH Key,并将复制内容拷贝到其中,选择保存。6,再次测试$ ssh -T git@github.com,提示
You've successfully authenticated, but GitHub does not provide shell access.