You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Git克隆仓库失败:连接GitHub端口80超时求助

Fixing Git "Failed to connect to github.com port 80: Timed out" Error

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 run ping github.com in 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.git
    

    Note: 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:port
    

    If you don’t need a proxy anymore, clear these settings with:

    git config --global --unset http.proxy
    git config --global --unset https.proxy
    
  • Check 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.git
    

    Keep 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 300
    

    This 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.

火山引擎 最新活动