Git克隆仓库失败:连接GitHub端口80超时求助
Hey there, I’ve run into this exact issue before — let’s walk through the most effective fixes to get your clones working again:
Verify your basic network connectivity
First, check if you can actually reach GitHub. Open your browser and try loading the GitHub website — if that times out too, the problem is with your network (ISP restrictions, firewall, or proxy issues). You can also runping github.comin your terminal; if you don’t get responses, that confirms a network block.Switch to SSH instead of HTTP
Port 80 for HTTP is often blocked by firewalls or corporate networks. Using SSH bypasses this. Try cloning with the SSH URL instead:git clone git@github.com:symfony/symfony.gitNote: You’ll need to have an SSH key added to your GitHub account first (you can find steps to generate and add one directly in your GitHub account settings).
Configure Git to use a proxy (if applicable)
If you’re behind a corporate or residential proxy, Git might not be using it by default. Set the proxy settings globally:git config --global http.proxy http://your-proxy-address:port git config --global https.proxy http://your-proxy-address:portIf you don’t need a proxy anymore, clear these settings with:
git config --global --unset http.proxy git config --global --unset https.proxyCheck local firewall/antivirus software
Your local firewall or antivirus might be blocking Git’s outgoing requests. Temporarily disable it (just for testing) and try cloning again. If it works, add Git to the allowed apps list in your security software.Use a GitHub mirror (for restricted regions)
If you’re in a region where GitHub access is slow or restricted, try a mirrored repository. For example:git clone https://github.com.cnpmjs.org/symfony/symfony.gitKeep in mind mirrors might not be 100% up-to-date, but they’re a reliable workaround for connectivity issues.
Increase Git’s timeout threshold
Sometimes the issue is just slow network speed. Extend Git’s timeout settings to give it more time to connect:git config --global http.timeout 300This sets the timeout to 300 seconds (5 minutes) — adjust the number if needed.
Start with the first step (network check) since that’s the root of most timeout issues, then work through the others until you find what works for you!
内容的提问来源于stack exchange,提问作者Elodie G.




