方案一:
最近GitHub無法訪問?試了好多種方法胞锰,終于找到了你
一灾锯、進入hosts文件夾
?command + shift + G?
輸入?
?/private/etc/hosts
enter
二、修改hosts文件
hosts文件夾不可修改嗅榕,可拷貝一份到桌面顺饮,打開桌面的hosts文件
添加
# Github Hosts
# update: 2021-01-26
140.82.114.3 github.com
140.82.114.10 nodeload.github.com
140.82.113.5 api.github.com
140.82.114.10 codeload.github.com
185.199.108.153 training.github.com
#185.199.108.153 assets-cdn.github.com
185.199.108.153 documentcloud.github.com
185.199.108.154 help.github.com
185.199.108.153 githubstatus.com
199.232.69.194 github.global.ssl.fastly.net
199.232.96.133 raw.github.com
199.232.96.133 raw.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 marketplace-screenshots.githubusercontent.com
199.232.96.133 repository-images.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com
199.232.96.133 desktop.githubusercontent.com
199.232.5.194 github.global.ssl.fastly.net
199.232.96.133 avatars.githubusercontent.com
199.232.96.133 avatars0.githubusercontent.com
199.232.96.133 avatars1.githubusercontent.com
199.232.96.133 avatars2.githubusercontent.com
199.232.96.133 avatars3.githubusercontent.com
199.232.96.133 avatars4.githubusercontent.com
199.232.96.133 avatars5.githubusercontent.com
199.232.96.133 avatars6.githubusercontent.com
199.232.96.133 avatars7.githubusercontent.com
199.232.96.133 avatars8.githubusercontent.com
# End of the section
刪除/private/etc/路徑下的hosts文件
將拷貝修改后的hosts文件拖入/private/etc/下
刪除和拖入hosts文件 可能需要輸入密碼
三吵聪、終端操作
打開終端輸入sudo killall -HUP mDNSResponder
enter
輸入密碼
enter
至此,打開你的瀏覽器兼雄,就可以訪問GitHib 了R魇拧!赦肋!大功告成?樵堋!佃乘!
方案二:
2021年 6月9號 剛測試:最新解決辦法:
在etc/host 中底部加入代碼囱井,不需要使用上面的代碼,只需要加入下面幾行就行
140.82.114.3 github.com
199.232.69.194 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
最后別忘記打開終端 加入? 打開終端輸入sudo killall -HUP mDNSResponder?
enter
輸入密碼
enter
最后就可以訪問