Set proxies to solve : Failed to connect to github.com port 443 after XXXXX ms: Timed out

Getting 'Failed to connect to github.com port 443: Timed out' when pushing to GitHub? This guide shows how to configure Git proxies to fix the timeout for good.

Louis avatar
Set proxies to solve : Failed to connect to github.com port 443 after XXXXX ms: Timed out

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. For a comprehensive guide on configuring proxies at the Windows system level (not just Git), see How to Configure Proxy on Windows 11/10 and 7 on TheWindows12.

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  
Buy Me a Coffee

Comment

comments powered by Disqus
Louis

Written by : Louis

CNELECAR editor. Latest tech news, reviews, deals and resources.

Recommended for You

Download Every Chinese Textbook in PDF for Free: Primary to College Levels Covered

Download Every Chinese Textbook in PDF for Free: Primary to College Levels Covered

ChinaTextbook GitHub project offers free PDFs of Chinese textbooks from primary school to college. Browse, download and study every grade level at no cost.