git之fatal: Could not read from remote repository

问题背景:
在git bash中使用hexo g -d命令进行文章发布

详细错误信息:

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something‘s wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Connection reset by 13.250.177.223 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at ChildProcess.<anonymous> (E:\Hexo\node_modules\hexo-util\lib\spawn.js:37:17)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at ChildProcess.cp.emit (E:\Hexo\node_modules\cross-spawn\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:915:16)
    at Socket.stream.socket.on (internal/child_process.js:336:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:561:12)

错误原因是因为ssh key有问题,连接不上服务器。

于是我参考如下链接,一步一步操作,最终解决了这个问题:
git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”

虽然已经有了问题的解决答案,但是我觉得还是需要列举一下相关步骤,梳理一下:

1.重新在git设置一下身份的名字和邮箱

git config --global user.name "yourname"

git config --global user.email "[email protected]"

这里的yourname必须与github的用户名一致

这里[email protected]必须与github登录邮箱一致

2.删除.ssh文件夹下的known_hosts文件(该文件主要作用是域名解析)

3.ssh-keygen -t rsa -C “[email protected](填写github对应的邮箱)”

一路回车即可,无需输入

4.进入github设置界面

新增SSH key将id_rsa.pub内容添加到如图中的Key上(title可任意命名):

5.最后完美解决这个问题

原文地址:https://www.cnblogs.com/youcong/p/11111397.html

时间: 2024-11-10 07:00:45

git之fatal: Could not read from remote repository的相关文章

git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.

Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repositor

git提示错误关于错误:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

关于 Git 使用中出现的错误 饥人谷_楠柒 关注 2016.11.02 15:33* 字数 746 阅读 3607评论 5喜欢 10赞赏 1 关于错误:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository. QQ截图20161102144048.jpg 在我配置完公钥后想要进行远端Github上clone时出现了错误.经

fatal:&#39;origin&#39; does not appear to be a git repository fatal:Could not read from remote repository

天gitlab中遇到的问题: 当 git push origin branch_name时遇到报错如下: fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repository 原因: 本地分支和远程分支断开连接 解决方法: cd 本地分支里1.git branch                ——*master   只显示master 然后查看是否从上游拉了2.git

【git基础】Permission denied (publickey). fatal: Could not read from remote repository

运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.223)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes

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

GitLab push远端,出现错误提示:Push failed: Failed with error: fatal: Could not read from remote repository. 原因: 1,账号无push的权限. 2,请添加一个正确的sshKey 添加方法: ssh-keygen -t rsa -C "账号" cat ~/.ssh/id_rsa.pub 将ssh保存到 GitLab即可

git: fatal: Could not read from remote repository

This is probably an Intellij problem. Your key are managed natively by ssh, and Intellij has it's own ssh program. Go to the settings, search git->ssh executable then choose native As seen here : git with IntelliJ IDEA: Could not read from remote rep

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,然后重新生成k

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

第一次提交遇到这样的情况,怎么回事呢,我在github上提交了ssh key 的啊. 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 host :    sudo vi /etc/hosts  (添加下面第三行) 127.0.0.1 localhost localhost.localdomain VM-0-6-ubuntu 127.0.1.1 TENCENT 192.30.255.113 github.com # 添加ip # The followi

bitbucket工程改名导致 repository does not exist. fatal: Could not read from remote repository.

在bitbucket上把工程改名了,就忘了. 结果同步时报错. 先在本地查看一下 git remote -v 果然是工程的老名字 origin [email protected]:XXX/oldname.git (fetch)origin [email protected]:XXX/oldname.git (push) 参考https://stackoverflow.com/questions/24875756/conq-repository-does-not-exist-fatal-could