fatal: Could not read from remote repository. Please make sure you have the correct access rights

使用git clone命令从github上同步github上的代码库时,如果使用SSH链接,系统会报下面的错误

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.


原因:

你的SSH key没有添加到github帐号设置中


解决:

需要在本地创建SSH key,然后将生成的SSH key文件内容添加到github帐号上去。创建SSH key的方法很简单。

生成SSH公钥



接着拷贝.ssh/id_rsa.pub文件内的所以内容,将它粘帖到github帐号管理中的添加SSH key界面中。

扫描二维码关注公众号,回复: 2392711 查看本文章

打开github帐号管理中的添加SSH key界面的步骤如下:

1. 登录github

2. 点击右上方的settings图标,添加即可


再进行git clone 操作:


猜你喜欢

转载自blog.csdn.net/cheneykl/article/details/80769747
今日推荐