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
找了一些教程,说是把 .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
即可
版权属于:CodeAnime
本文链接:https://codeanime.cn/index.php/archives/73/
欢迎任何形式的转载,但请务必注明出处。由于笔者水平有限,如果文章或代码有表述不当之处,还请不吝赐教。喵~