赞
踩
最近使用 git
拉取 Github 上的项目时老是出现 Connection refused
:
$ git pull origin master
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
网上的解决办法
解决ssh: connect to host github.com port 22: Connection refused
vim ~/.ssh/config
Host github.com
User xxxxx@xx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
但是在使用了这个方法后依然无法解决:
$ git pull origin master
ssh: connect to host ssh.github.com port 443: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
然后看见隔壁工位上大哥的搜索栏上赫然也是这个问题,交流一番应该是最近墙比较敏感的问题。
解决方法也从大哥那里找到了,不得不说大哥YYDS,我还是太年轻了:
github.com
查找到其IP地址hosts
文件中即可,例子:140.82.112.4 github.com
host
默认地址: C:\Windows\System32\drivers\etc
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。