Git操作Github网速慢的解决方式

  1. 对于https协议,配置git proxy,注意把http和https都配置上,git config --global http.proxy http://127.0.0.1:7890
  2. 修改host文件
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    nslookup github.global.ssl.fastly.net
    nslookup github.com

    # vim /etc/hosts
    xxx github.global.ssl.fastly.net
    xx github.com

    # refresh DNS cache
    # linux
    sudo /etc/init.d/networking restart
    # or nscd -i hosts
    # arch linux
    /etc/rc.d/nscd restart
    # macos
    dscacheutil -flushcache