Git操作GitHub时的Proxy配置

时间:2023-12-30 22:22:32
无论是使用Android Studio中,VCS >> Git >> Clone, 还是直接Git Clone命令,clone GitHub项目时,出现错误提示:LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Git操作GitHub时的Proxy配置
但此时,电脑访问网络已经通过**,可以正常访问GitHub等资源。
*配置如下:
Git操作GitHub时的Proxy配置
Android Studio中,Preferences >> HTTP Proxy中,如下图配置完,重新Clone GitHub项目,依然出现同样的错误提示,这应该是Android Studio中的一个bug。
 Git操作GitHub时的Proxy配置
解决方案:
git config --global http.proxy 'socks5://127.0.0.1:1086'
git config --global https.proxy 'socks5://127.0.0.1:1086'
git config --global --list 显示git config global配置信息。
再次git clone xxx 即可。
如需要对应还原git proxy,可以使用命令:
git config --global --unset http.proxy
git config --global --unset https.proxy
git proxy如果需要设置账号密码及端口。具体配置如下:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:port