github加速

Github一般用于Git的远程仓库,由于服务器位于国外,国内访问速度比较慢,为了提高访问速度,绕过DNS域名解析。

获取Github的IP地址
按下ctrl+alt+T打开命令终端,输入:

nslookup github.com

 

获取github.global.ssl.fastly.net的IP地址
按下ctrl+alt+T打开命令终端,输入:

nslookup github.global.ssl.fastly.net

 

写入hosts文件,刷新缓存
按下ctrl+alt+T打开命令终端,输入:

sudo gedit /etc/hosts
然后在文件末尾加上:

#github
20.205.243.166 http://github.com
20.205.243.166 https://github.com

31.13.75.12 http://github.global.ssl.fastly.net
31.13.75.12 https://github.global.ssl.fastly.net

最后刷新缓存,在命令终端输入:

sudo /etc/init.d/network-manager restart

 

全局加速(镜像)

常用站点:

https://mirror.ghproxy.com/

https://gitclone.com/

https://cnpmjs.org/

https://shrill-pond-3e81.hunsh.workers.dev/

https://fastgit.org/

加速后网址:https://gitclone.com/github.com/...

设置全局加速:

git config --global url."https://gitclone.com/".insteadOf https://

git config --global -l 查看

git config --global --edit 编辑

 

posted @ 2024-10-11 16:43  妖岭  阅读(313)  评论(0)    收藏  举报