解决git clone fatal: port 443: Timed out

问题描述

在git clone google的某些资源时,可能会碰到git clone fatal的连接超时错误,例如在clone下面的项目时

git clone https://android.googlesource.com/platform/external/libpng

会提示如下的错误:

Cloning into 'libpng'...
fatal: unable to access 'https://android.googlesource.com/platform/external/libpng/':
Failed to connect to android.googlesource.com port 443: Timed out

解决方案:

在git config中设置全局代理。

首先查看自己VPN的代理地址,例如我的代理地址如下:

解决git clone fatal: port 443: Timed out_第1张图片
我的代理地址是127.0.0.1,端口(HTTP Port)是1087,所以在命令行里输入如下语句:

git config --global http.proxy http://127.0.0.1:1087

之后再次git clone,发现问题已解决。

> git clone https://android.googlesource.com/platform/external/libpng
Cloning into 'libpng'...
remote: Sending approximately 13.32 MiB ...
remote: Counting objects: 1339, done
remote: Total 77860 (delta 70139), reused 77860 (delta 70139) eceiving objects: 100% (77860/77860),Receiving objects: 100% (77860/77860), 13.32 MiB | 3.24 MiB/s, done.

Resolving deltas: 100% (70139/70139), done.

你可能感兴趣的:(git,github)