-
修复 git 使用
httpspull 和 clone 时出现的下面的错误:unable to access 'https://github.com/xxx.git/': Failed to connect to github.com port 443 after 21088 ms: Couldn't connect to server这是由于网络代理出现的问题,添加
http.proxy可以解决该问题, 如git config --global http.proxy 127.0.0.1:80878087是代理的端口号 -
修复 git 使用
sshpull 和 clone 出现下面的错误ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.修复步骤:
-
先确保 git 通过 https pull 和 clone 没有问题
-
添加
.ssh/config文件, 内容如下:Host github.com Hostname ssh.github.com Port 443 User git -
运行
ssh -T git@github.com, 然后按提示进行操作。 -
再次运行
ssh -T git@github.com, 如果出现下面的信息表示成功Hi username! You've successfully authenticated, but GitHub does not provide shell access.
-