1
快速解决GitHub图裂和速度慢的问题
source link: https://thelighter.github.io/2020/06/28/github-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
快速解决GitHub图裂和速度慢的问题
发表于2020-06-28|更新于2021-01-15|GitHub
阅读量:11
一键解决GitHub速度慢、无法访问的问题
有时,GitHub因为种种原因导致无法正常访问,我们需要修改本地的hosts文件即可加速github访问和git clone
Windows用户
对于windows系统来说,找到C:\Windows\System32\drivers\etc\hosts
添加或者修改以下内容
输入以下内容:
日期:2020/6/24 搜查到新的地址和IP 已经实时更新!
#GitHub Start
140.82.112.3 github.com
140.82.113.3 gist.github.com
185.199.108.153 assets-cdn.github.com
199.232.68.133 raw.githubusercontent.com
199.232.68.133 gist.githubusercontent.com
199.232.68.133 cloud.githubusercontent.com
199.232.68.133 camo.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com
#GitHub End
如果无法修改的话,请修改权限给用户赋予修改文件的权限
mac用户
对于mac用户来说
在系统偏好设置中修改即可
1.打开系统偏好设置,底部有一个Hosts的快捷入口
2.输入ip和hostname后,回车确定,勾选改host即可
在终端中修改即可
sudo vi /etc/hosts
通过Finder直接修改即可
打开Finder,按快捷键组合 Shift+Command+G 查找文件,输入/etc/hosts,确认前往修改即可
Linux 修改hosts文件
Linux中添加或修改hosts的方法
vim打开 /etc/hosts,添加或修改hosts之后保存:
vim /etc/hosts
重启网络:
/etc/init.d/networking restart
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK