这篇文章memo一下github下载的设定方式。
设定内容
将一下内容设定到hosts设定文件中
设定IP地址 | 域名信息 |
---|---|
192.30.253.112 | github.com |
151.101.72.133 | assets-cdn.github.com |
151.101.193.194 | github.global.ssl.fastly.net |
IP查询地址:https://www.ipaddress.com/
以github.com为例:
设定方法(Linux/Mac)
将上述设定内容设定到下面的hosts文件中即可
设定文件:
/etc/hosts
设定方法(Windows)
将上述设定内容设定到下面的hosts文件中即可
设定文件:
Windows\System32\drivers\etc\Hosts
辅助步骤:
ipconfig /flushdns
注:windows需要手动进行flushdns操作方可起效
设定示例
以下以easypack的git clone动作为例,操作日志如下所示,目前4M左右,10s上下还是可以接受的程度。
- Linux(CentOS7.5)
[root@host131 tmp]# tail -n3 /etc/hosts
192.30.253.112 github.com
151.101.72.133 assets-cdn.github.com
151.101.193.194 github.global.ssl.fastly.net
[root@host131 tmp]# time -p git clone http://github.com/liumiaocn/easypack.git
Cloning into 'easypack'...
remote: Enumerating objects: 405, done.
remote: Counting objects: 100% (405/405), done.
remote: Compressing objects: 100% (248/248), done.
remote: Total 2119 (delta 189), reused 307 (delta 108), pack-reused 1714
Receiving objects: 100% (2119/2119), 1.81 MiB | 300.00 KiB/s, done.
Resolving deltas: 100% (995/995), done.
real 11.80
user 0.12
sys 0.23
[root@host131 tmp]#
- MacOS
liumiaocn:sss liumiao$ tail -n3 /etc/hosts
192.30.253.112 github.com
151.101.72.133 assets-cdn.github.com
151.101.193.194 github.global.ssl.fastly.net
liumiaocn:sss liumiao$ time -p git clone http://github.com/liumiaocn/easypack.git
Cloning into 'easypack'...
warning: redirecting to https://github.com/liumiaocn/easypack.git/
remote: Enumerating objects: 405, done.
remote: Counting objects: 100% (405/405), done.
remote: Compressing objects: 100% (248/248), done.
remote: Total 2119 (delta 189), reused 307 (delta 108), pack-reused 1714
Receiving objects: 100% (2119/2119), 1.81 MiB | 242.00 KiB/s, done.
Resolving deltas: 100% (995/995), done.
real 10.39
user 0.24
sys 0.18
liumiaocn:sss liumiao$
今天的文章Github加速设定分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/7473.html