Git突然失效的解决办法,ssh: connect to host github.com port 22: Connection timed out fatal - Git Bash中报错内容是这样的: ssh: connect to host github
Git Bash中报错内容是这样的: ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. 错误解释: 可能是Git 无法通过 SSH 连接到 GitHub 的服务器 我尝试过自己gitee是好的,前两天也能用github突然一下有点懵,然后我在Git Bash中试了一下ssh -T git@github.com 发现ssh确实是不好的,报错是ssh: connect to host github.com port 22: Connection timed out 解决方法 1.找到自己的.ssh文件夹,windows一般是C:\Users\你的用户名.ssh 2.创建一个txt文件,在里面写上如下内容,意思就是从22端口改为443
Host github.com
Hostname ssh.github.com 拼多多帮助力入口
Port 443
3.将这个.txt的文件名称改为config,记住什么后缀都不要,不要.txt!! 4.然后运行Git Bash,弹出如下界面,输入yes即可,大致意思应该是需要修改端口了是否确定 5.然后再使用git push提交一次试试 补充:很可能是22端口被什么东西占用了,想要从443端口改回22端口的话,只要删掉这个config文件就能复原了
精彩文章