git push出现的问题

输入命令git push origin master.
错误一:
一直报错:

fatal: ‘origin‘ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists

就目前个人经验而言,有两种情况:
1.未建立origin
解决方法:

  • 输入git remote add origin + 你的github仓库地址

如果出现 fatal: remote origin already exists.
就再输入git remote rm origin
如不报错,再重复第一步操作。

如果输入 git remote rm origin 还是报错:error: Could not remove config section ‘remote.origin’. 就需要修改gitconfig文件的内容

找到你的github的安装路径。

找到一个名为gitconfig的文件,打开它,把里面的[remote “origin”]那一行删掉。

2.将本地的库删掉,重新再将仓库从远端克隆下来。

错误二:

error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054

全部错误描述如下图:
在这里插入图片描述
至于这个错误,我在百度上查了很多,基本上都说服务器的SSL证书没有经过第三方机构的签署,建议输入git config http.sslVerify "false"
这个我就不多说了,这里附上参考链接:https://blog.csdn.net/m0_37052320/article/details/77799413
但我感觉上述一般适用于刚开始用git,第一次push不上去的老铁们。如果你之前push成功过无数次,突然出现这样的情况,那么很有可能是你当前的网络原因,push执行三次,不行的话就换一个网络。我被学校的校园网坑惨了,小题大做。
错误三
未将本地和远端仓库同步。
假如你在远端的github上修改了仓库里的内容,那么在使用git push之前一定要先使用git pull同步仓库动态。
当然也有可能是你的网络原因,一般没联网的话是不可能push成功的哦。

发布了50 篇原创文章 · 获赞 30 · 访问量 9178

猜你喜欢

转载自blog.csdn.net/qq_42913794/article/details/102693098