Recently we’ve encountered this issue many times while pushing updates to GitHub: " Failed to connect to github.com port 443 after XXXXX ms: Timed out." In this post, we’ll show you how we solved it.
Apparently, this is a network issue between local machine and GitHub, we could set proxies for Git to fix it.
Run follwing commands in the Terminal/Shell:
git config --global http.proxy socks5://192.168.7.10:7891
git config --global https.proxy socks5://192.168.7.10:7891
The above two lines of commands set up Git’s global http and https proxies, using the socks5 protocol. In actual operation, just change the proxy server information to your own.
After the change, try to push again and everything will go smoothly.
If you want to unset Git’s global proxy settings, just execute the following command:
git config --global --unset http.proxy
git config --global --unset https.proxy
