ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

一键解决git clone慢的问题

2021-02-11 16:00:09  阅读:222  来源: 互联网

标签:githubusercontent git clone 一键 github comavatars0 108.133 185.199 com


问题

国内使用git clone命令或者连接github网站时速度特别慢,其原因是github的相关域名遭到了DNS污染。

解决思路

http://tool.chinaz.com搜索github/gitlab等相关域名指向连接速度最快的IP地址,将其配置到本机的DNS配置文件。

解决效果

以deck.gl为例,速度提升到11M每秒。
在这里插入图片描述

嫌麻烦一键解决

为了方便配置,我将整个配置过程编写成了一个自动化软件,直接运行即可,源代码托管在github。

  1. 下载gitfree
  2. 如果你是WINDOWS用户,直接右击使用管理员权限运行即可。
  3. 如果你是LINUX/MACOS用户,直接进入gitfree所在文件夹,以管理员权限运行即可:sudo ./gitfree
  4. 原DNS配置文件会自动备份在gitfree所在目录下。

不嫌麻烦手动解决

  1. 登录http://tool.chinaz.com,搜索github.com gitlab等域名,记录下对应的速度最快的IP地址。
  2. 在本机的DNS配置文件最后添加对应配置。
  • windows路径:C:\Windows\System32\drivers\etc\hosts
  • linux/macos路径:/etc/hosts
  1. 修改前记得备份。
# ......
# 原来的配置信息
172.65.251.78 gitlab.com
52.74.223.119 github.com
185.199.109.154 github.githubassets.com
185.199.109.133 avatars8.githubusercontent.com
185.199.109.133 avatars7.githubusercontent.com
185.199.109.133 avatars6.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.110.133 avatars4.githubusercontent.com
185.199.109.133 avatars3.githubusercontent.com
185.199.111.133 avatars2.githubusercontent.com
185.199.109.133 avatars1.githubusercontent.com
185.199.109.133 avatars0.githubusercontent.com
185.199.111.133 avatars0.githubusercontent.com
185.199.111.133 avatars0.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.111.133 avatars.githubusercontent.com
185.199.111.133 avatars.githubusercontent.com
31.13.81.17 github.global.ssl.fastly.net
185.199.108.133 camo.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.110.133 gist.githubusercontent.com
0.0.0.0 raw.githubusercontent.com
185.199.108.153 assets-cdn.github.com

附录——需要搜索的域名

  • gitlab.com
  • github.com
  • github.githubassets.com
  • avatars8.githubusercontent.com
  • avatars7.githubusercontent.com
  • avatars6.githubusercontent.com
  • avatars5.githubusercontent.com
  • avatars4.githubusercontent.com
  • avatars3.githubusercontent.com
  • avatars2.githubusercontent.com
  • avatars1.githubusercontent.com
  • avatars0.githubusercontent.com
  • avatars0.githubusercontent.com
  • avatars0.githubusercontent.com
  • avatars0.githubusercontent.com
  • avatars0.githubusercontent.com
  • avatars0.githubusercontent.com
  • avatars.githubusercontent.com
  • avatars.githubusercontent.com
  • github.global.ssl.fastly.net
  • camo.githubusercontent.com
  • cloud.githubusercontent.com
  • gist.githubusercontent.com
  • raw.githubusercontent.com
  • assets-cdn.github.com

标签:githubusercontent,git,clone,一键,github,comavatars0,108.133,185.199,com
来源: https://blog.csdn.net/qqRyze/article/details/113790589

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有