github访问慢的解决方法

1. 修改本地hosts文件

windows系统的hosts文件的位置如下:C:\Windows\System32\drivers\etc\hosts
mac/linux系统的hosts文件的位置如下:/etc/hosts

如果window的
C:\Windows\System32\drivers\etc\hosts不让修改,可以复制出来修改,然后拖进去

2. 增加的映射

获取Github相关网站的ip
访问https://www.ipaddress.com,拉下来,找到页面中下方的“IP Address Tools – Quick Links”
分别输入github.global.ssl.fastly.net和github.com,查询ip地址
下面是我的配置
140.82.114.4	github.com
199.232.5.194	github.global.ssl.fastly.net

让hosts文件立刻生效:Win+R->cmd->ipconfig /flushdns

参考:
https://zhuanlan.zhihu.com/p/93436925

3、git忽略本地文件
git update-index --skip-worktree /path/to/file

https://mengqi92.github.io/2020/07/17/hide-files-from-git/

posted on 2021-08-19 10:00  星星眨着眼  阅读(61)  评论(0编辑  收藏  举报

导航