使用代理后git报错

使用代理后github push报错:
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

git push免密
git config --global credential.helper store

解决:Connecting to raw.githubusercontent.com(raw.githubusercontent.com)|0.0.0.0|:443... failed: Connec
[root@master ~]# vi /etc/hosts
185.199.110.133 raw.githubusercontent.com

排除是ssh的问题
是代理的问题,git不是自动走代理的
我所用的是clash,综合来看只需在push的时候开启

git config --global http.proxy "socks://127.0.0.1:10808"
git config --global https.proxy "socks://127.0.0.1:10808"

解决方法:
将其端口改为443
https://www.v2ex.com/t/819005
clash使用文档https://docs.cfw.lbyczf.com/

https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port
https://github.com/vernesong/OpenClash/issues/1960

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容