git使用产生fatal: Could not read from remote repository. Please make sure you have the correct acces...

使用git时候会遇到类似情况:

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


出现这个问题是因为没有在github账号添加SSH key

解决方法如下:

1.在终端输入。

ssh-keygen -t rsa -C "username" (注:username为你git上的用户名)

如果执行成功。返回


选择

y

返回结果:


继续输入:

cat /Users/niulujia/.ssh/id_rsa.pub



把显示出来的SSH keys直接添加到github账户设置里边的SSH keys

最后再执行git clone命令就可以了

你可能感兴趣的:(git使用产生fatal: Could not read from remote repository. Please make sure you have the correct acces...)