1.日常操作,提交代碼,報錯誤下:
$ git clone git@github.com:hanchao5272/myreflect.git Cloning into 'myreflect'... ssh_dispatch_run_fatal: Connection to 13.250.177.223 port 22: Software caused connection abort fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
2.開始百度:
2.1重置了本機用戶名和郵箱,重新生成公鑰,失敗
2.2看到有人說本地郵箱和生成公鑰郵箱必須一致,必須是GitHub登陸的郵箱,於是我又統一了一下了GitHub和本機的郵箱,失敗
2.3然后看到有大神說是本機dns的問題,按照大神的辦法,解決。
1.首先你需要打開命令台,測試一下看是不是連接不上: ping github.com 如果顯示連接失敗,那就往下看 2.打開C:\Windows\System32\drivers\etc\hosts 在文件內底部寫入以下兩個地址 192.30.255.112 github.com git 185.31.16.184 github.global.ssl.fastly.net 3.再到命令台測試一下,如果成功則可以正常使用git了;
*補充:我犯了一個錯誤,就是再GitHub的郵箱控制的地方,把我的郵箱設置成不公開了,於是,是的提交代碼的時候報錯,說我郵箱有問題,於是又到GitHub把郵箱設置成公開。
大神地址:https://blog.csdn.net/hanchao5272/article/details/79393393