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

新电脑与git仓库建立连接:

1. 在本地终端运行 ssh-keygen -t rsa -C "username"  (注: username为你在git上的用户名)

2. 对于所有提示信息按Enter键设为默认值,成功之后会自动生成ssh文件

3. 打开/user/administrator/.ssh(也有可能不是这个路径,需要找一下),打开文件id_rsa.pub, 复制里面的秘钥

4. 打开github账户设置,进入SSH and GPG keys,将秘钥添加到ssh keys

5. 在本地就可以正常运行git clone等操作了

posted @ 2021-09-22 14:04  小情绪^_^  阅读(370)  评论(0编辑  收藏  举报