背景
git push 代码报错
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决办法:
- 确认是否在git仓库上注册 ssh 公钥
- 有可能是网络问题
怎么检查是否网络问题?
ssh git@git.XXX.com -vT
出现ssh_exchange_identification: read: Connection reset by peer
就是网络问题
此时 ping 仓库地址, 可能是通的,但还是有问题
如果输出如图所示,此时网络OK, 可以push了