遇到的问题
好久没有更新自己的博客了,实在是因为最近很忙,但是最近遇到过一个问题有必要记录一下,就是使用git push -u origin master
提交代码的时候,一直报ssh: connect to host xxxxxxxxxx port 22222: Connection refused fatal: Could not read from remote repository.
尝试方法
尝试了很多方法,借鉴了:
https://blog.csdn.net/lw545034502/article/details/90696872
主要是删除生成的ssh,然后重新生成,但是这种办法还是没有解决pull报错的问题
解决方法
总结一下就是:git 远程仓库两种协议,得知ssl协议被禁掉后,只能换http协议连接进行合并本地仓库了。
第一步:查询远程仓库使用的那种协议连接
git remote -v
第二步:删除之前的SSL远程仓库协议
git remote rm origin
第三步:添加https协议的远程仓库
git remote add origin http://gitcode.`xxxxxxxxxxxxxx.git
第四步:push代码
git push -u origin master
OK,大功告成!
感觉原创作者,链接如下:
https://blog.csdn.net/s740556472/article/details/80318886