fatal: Could not read from remote repository.的解决办法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了fatal: Could not read from remote repository.的解决办法相关的知识,希望对你有一定的参考价值。

1、 git remote –v查看远端地址或者查看配置 git config –list 

技术分享

2、 git status

技术分享

3、 git add . 
git status 
git commit -m “本次要提交的概要信息” 
git push origin master把本地文件推送到远程仓库 

技术分享

4、git remote set-url origin 你的远端地址 
设置远端仓库地址 
git push origin master出现以下情况: 

技术分享

5、解决办法:删除远端当前仓库和当当前key,然后重新生成key, 
ssh-keygen -t rsa -C [email protected]连敲两次回车键

技术分享

6、会在本地C:\\Users\\你的用户名.ssh生成文件夹,里面有id_rsa和id_rsa.pub两个文件 
然后复制id_rsa.pub文件里面的内容,到https://github.com/settings/keys新建一个, 

技术分享

7、然后设置远程地址:(上面新建的) 
git remote add origin_new 新的地址 
git remote –v查看 
git push origin_new master重新推送 
下面是设置用户名 
Git config –global user.name “用户名” 
git config –global user.email 邮箱地址

以上是关于fatal: Could not read from remote repository.的解决办法的主要内容,如果未能解决你的问题,请参考以下文章

Push failed: Failed with error: fatal: Could not read from remote repository

Permission denied (publickey). fatal: Could not read from remote repository.

fatal: Authentication failed could not read from remote repository

fatal: Authentication failed could not read from remote repository

fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repos

fatal: Could not read from remote repository.的解决办法