执行git push到到 Github出错
$ git push -u origin main
kex_exchange_identification: read: Connection reset by peer
Connection reset by 20.205.243.166 port 22
fatal: Could not read from remote repository.

用vscode和idea都报了这个错
之前一直可行,怎么突然不行了?发现是我换了代理软件,用的端口变了导致。

ssh添加代理搞定的

Windows 用户编辑 ~/.ssh/config 文件,给文件加上以下内容,重启git bash.
具体端口需要根据你的代理软件设置决定。

Host github.com
    User git
    ProxyCommand connect -H 127.0.0.1:7890 %h %p