解决fatal: unable to access ‘https://github.com/xxxxxx.git/‘: Failed to connect to github.com port 443

我执行git pull的时候报错如下:fatal: unable to access ‘https://github.com/xxxxx.git/’: Failed to connect to github.com port 443 after 21110 ms: Couldn’t connect to server

原因是git没有连接上github,所以无法进行代码拉取

解决方法:

法一:取消代理设置,让其直接连接网络进行操作。

git config --global --unset http.proxy 
git config --global --unset https.proxy

法二:清理DNS缓存
win + R 打开cmd,执行如下命令

ipconfig/flushdns

法三:搭梯子(VPN)

我尝试了法一,法二,都分别成功了。有时候和网络有关,可以等待多测试几次。