通过Android Studio clone Github 上项目时候,出现Could not read from remote repository错误
1. 网上方法:
打开AndroidStudio -setting-VersionControl-git-SSH-executable设置为 Native
但是并没有解决问题,依旧Could not read from remote repository
【解决方法】
git没有添加github上的私钥
【步骤】
1.打开git安装目录下的 git-bash
2. 输入: ssh-keygen -t rsa -C "xxx" [ps:xxx是你git的name,查看命令为:git config --list]
3.然后回车,三次回车出现以下即为成功
The key fingerprint is:
SHA256:ybr8edDbPmEHGuocXnmjaPROq3Ra7jFPiAqpb0X0g44 xxxx
The key's randomart image is:
+---[RSA 2048]----+
| |
| . |
| . o |
| o.o.. . |
| + S+ + . |
| E.o.=.=.= . |
| o..=o*B*.+ |
| ..o +*B=*o |
| .o. +o===.o. |
+----[SHA256]-----+
4.获取key;cat ~/.ssh/id_rsa.pub
5.打开github -所在项目下-Setting-Deploy keys,添加第四部获取的key即可