Git报错(一)fatal: Could not read from remote repository.

解决方案来自CSDN:https://blog.csdn.net/cxwtsh123/article/details/79194263?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.control

一、完整错误信息

git push origin master
Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
``

报错截图

二、解决方案

1)、第一步:生成ssh-key

ssh-keygen -t rsa -C "urername"   // username Github账户名称
生成成功页面

ps:我这因为之前有ssh-key 所有需要选择重写

2)、红线标注的位置是生成key值的位置 cat 命令查看key

 cat /Users/chenlibrary/.ssh/id_rsa.pub
key值

整体复制,从ssh-rsa开始

3)、到你的github,点击settings


进入设置界面

3)创建ssh key


选择页面

创建界面

ps:创建成功后,就能看到第三部的第一张图里面包含你创建的key值

里面有一个步骤需要你输入密码,输入密码之后,以后提交代码都需要这个密码

你可能感兴趣的:(Git报错(一)fatal: Could not read from remote repository.)