访问github网页,一般来说都没问题,但是如果通过git clone 下载github中仓库的代码,动辄几k每秒的速度,实在太酸爽

解决办法:设置代理(需要科学上网)

1,查看科学上网的代理断口(mac)

系统偏好设置>网络>高级, 如下图,我的代理端口和ip ,1087, 127.0.0.1

image-20230526155036651

2,设置git 的代理端口(填入上一步获取的ip和端口)

1
2
3
4
5
6
7
#配置 git代理配置:
git config --global http.proxy http://127.0.0.1:1087
git config --global https.proxy http://127.0.0.1:1087

# 恢复 git代理配置(不需要的时候最好恢复)
git config --global --unset http.proxy
git config --global --unset https.proxy

来源:

mac http&git代理配置 - 简书 (jianshu.com)