Git踩坑----fatal: unable to access 'http://github.com/jpdjpd/img.git/': OpenSSL SSL_read: Connection was reset, errno 10054

今天把github一个仓库删了,然后重新上传,执行命令git push -u origin master出现报错fatal: unable to access 'http://github.com/jpdjpd/img.git/': OpenSSL SSL_read: Connection was reset, errno 10054

image-20211006085035043

找了一些教程,说是把 .git/cofig中的url里https改成http就OK,但试了之后没有成功,可能由于我本地有两个不同的github账号的原因吧

还有一种说法就是:解除ssl验证后,再上传就OK了git config --global http.sslVerify "false",但是也没有成功.

我这里的正解:

修改.git/config中的url为你github上仓库的ssh连接即可

把:

原来配置的git remote add origin https://github.com/jpdjpd/img.git

[remote "origin"]
	url = https://github.com/jpdjpd/img.git
	fetch = +refs/heads/*:refs/remotes/origin/*

改为:

[remote "origin"]
	url = git@github.com:jpdjpd/img.git
	fetch = +refs/heads/*:refs/remotes/origin/*

再进行git push -u origin master即可

image-20211006085759359

Q.E.D.


樱花庄的一只二刺猿