今天在使用git push到github的时候遇到了这样的错误
$ git push
fatal: NotSupportedException encountered.
ServicePointManager 不支持具有 socks5 方案的代理。
造成无法直接使用公钥push,需要手动输入用户名以及密码才能push
一开始以为是设置了环境变量代理 使用env|grep proxy发现没有查到
后来记起来之前的时候嫌弃github下载太慢配置了git config
贴一段处理的方式防止自己忘记了
// 查看当前代理设置
git config --global http.proxy
git config --global https.proxy
// 设置当前代理为 http://127.0.0.1:1080 或 socket5://127.0.0.1:1080
git config --global http.proxy 'http://127.0.0.1:1080'
git config --global https.proxy 'http://127.0.0.1:1080'
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
// 删除 proxy
git config --global --unset http.proxy
git config --global --unset https.proxy