美文网首页
git 速度慢解决方案(亲测有效)

git 速度慢解决方案(亲测有效)

作者: 剧变 | 来源:发表于2019-09-26 14:31 被阅读0次

1.上IP Lookup,查看以下两个github域名的ip

  • github.global.ssl.fastly.net

  • github.com

2.获取ip后按以下格式写入hosts文件


151.101.185.194 global-ssl.fastly.net

140.82.113.3  github.com

  • hosts文件路径:

    • mac:/private/etc/hosts

    • windows: C:\Windows\System32\drivers\etc\host

  • ip经常会变,如发现速度又下降了,及时去更换ip

3.重启网络

  • 终端输入sudo dscacheutil -flushcache

  • 输入密码重启网络

4. 如果以上3点都不行,可以通过SS代理设置github

  • git config --global http.https://github.com.proxy socks5://127.0.0.1:1086

  • git config --global https.https://github.com.proxy socks5://127.0.0.1:1086

  • 这里的端口号1086根据自己的来设置

  • 取消:

    • git config --global --unset http.proxy
    • git config --global --unset https.proxy

相关文章

网友评论

      本文标题:git 速度慢解决方案(亲测有效)

      本文链接:https://www.haomeiwen.com/subject/jytnuctx.html