我正在尝试克隆github wiki并创建一个用于RStudio的本地存储库,类似于我使用github和wiki所在的主存储库。我正在尝试克隆wiki per the instructions是命令行的错误输出:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\trinker\GitHub>git clone git@github.com:trinker/qdap.wiki.git
Cloning into 'qdap.wiki'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
我在stackoverflow上搜索了错误信息并获得了这篇文章(LINK)。错误消息几乎完全相同。我和那张海报之间的区别是我对命令行不满意,不知道输入什么来解决问题。我尝试了这个家伙的修复(LINK),这就是结果:
C:\Users\trinker\GitHub>set HOME=C:\Users\trinker
C:\Users\trinker\GitHub>ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/trinker/.ssh/id_rsa): C:\Users\tri
nker\.ssh
C:\Users\trinker\.ssh already exists.
Overwrite (y/n)? n
C:\Users\trinker\GitHub>ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/trinker/.ssh/id_rsa):
/c/Users/trinker/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/trinker/.ssh/id_rsa.
Your public key has been saved in /c/Users/trinker/.ssh/id_rsa.pub.
The key fingerprint is:
d6:ce:b5:23:0c:0d:c0:31:9f:8e:32:34:b9:79:43 trinker@TRINKER-HP
C:\Users\trinker\GitHub>CD C:\Users\trinker\GitHub
C:\Users\trinker\GitHub>git clone git@github.com:trinker/qdap.wiki.git
Cloning into 'qdap.wiki'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
C:\Users\trinker\GitHub>
注意我更改了密钥中的一些字符,因为我不确定这是不安全的事情。
Windows 7用户
答案 0 :(得分:2)
除了创建一对新密钥之外,您还需要告诉GitHub。在this help page的底部,您会找到详细说明:
- 转到您的帐户设置
- 点击左侧边栏中的“SSH密钥”
- 点击“添加SSH密钥”
- 将您的密钥粘贴到“密钥”字段
- 点击“添加密钥”
- 输入您的GitHub密码确认操作
您也可以在相同的设置中删除旧密钥,因为您可能不再需要它们了。