这次要在github上面取一个开源项目的源码,在网上搜了一下,发现有个命令可以执行
git clone git@github.com:xxx/xxxx.git
执行结果:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
貌似是没有某种权限的样子。
后来在网上找了一下,发现有不类似问题,在github官网上也有类似的:
https://help.github.com/articles/error-permission-denied-publickey/#platform-linux
下面两章是介绍如果将SSH KEY添加到GITHUB:
https://help.github.com/articles/generating-ssh-keys/
https://help.github.com/articles/keeping-your-ssh-keys-and-application-access-tokens-safe/
上面这些准备好之后,就可以开始下载源码了:git clone git@github.com:xxx/xxxx.git
remote: Counting objects: 305032, done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 305032 (delta 12), reused 0 (delta 0), pack-reused 304961
接收对象中: 100% (305032/305032), 474.38 MiB | 796.00 KiB/s, done.
处理 delta 中: 100% (193854/193854), done.
Checking out files: 100% (7351/7351), done.