期间查了好多资料,包括取消系统代理,更改mac的host这种,
最终发现问题是很久以前设置过git的的全局代理…
所以取消git的全局代理就ok啦…
取消代理:
git config --global --unset http.proxy
git config --global --unset https.proxy
记录一下git的代理命令:
查看代理:
git config --global --get http.proxy
git config --global --get https.proxy
设置代理:
git config --global http.proxy ‘socks5://127.0.0.1:1080’
git config --global https.proxy ‘socks5://127.0.0.1:1080’
当然最好的方式就是把homebrew设置为国内的中科大源:
参考:
[1] 解决git下载出现:Failed to connect to 127.0.0.1 port 1080: Connection refused拒绝连接错误 https://blog.youkuaiyun.com/weixin_41010198/article/details/87929622
[2] 替换及重置Homebrew默认源 https://lug.ustc.edu.cn/wiki/mirrors/help/brew.git
[3] Homebrew切换为国内镜像源 https://blog.youkuaiyun.com/u013310075/article/details/103832893