安装完git后想从Git库中克隆项目,需要先生成密钥,否则会提示:Please make sure you have the correct access rightsand the repository exists 或Permission de
解决方法如下:
进入https://github.com/settings/profile查看自己的账号和邮箱,记到记事本下来,下面会用到。
打开Git输入命令
git config –global user.name “yourname” 回车
git config –global user.email “your@email.com” 回车
$ ssh-keygen -t rsa -C “your@email.com”(请填你设置的邮箱地址)回车
会出一些提示,无视这些一直点回车请继续直接按下回车
直到出现
The key’s randomart image is:
+—[RSA 2048]—-+
| ==++. . |
| . ++.o . .|
| ..o++Oo |
然后去save 目录下打开id_rsa.pub,复制里面内容。注意要复制全部内容包含ssh-rsa等开头
进入自己的账号https://github.com/settings/keys 点击 New sshKey 。
复制的内容粘贴到Key里,点击Add SSH Key按钮添加成功即可
