无法克隆github存储库

时间:2016-02-07 09:59:11

标签: git github

根据本指南: https://github.com/cytoscape/cytoscape

我正在Ubuntu上运行一个克隆一组github存储库的脚本: https://github.com/cytoscape/cytoscape/blob/develop/cy.sh

失败了:

$ ./cy.sh init
Target directory = 
Cytoscape project will be cloned to: /home/user/projects/cytoscape
Cloning: parent (URI = git@github.com:cytoscape/cytoscape-parent.git)
Cloning into 'parent'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Could not clone remote repository: /home/user/projects/cytoscape

如果我改为从命令行执行:

git clone https://github.com/cytoscape/cytoscape-parent.git

它有效。

关于什么系统:

git clone git@github.com:cytoscape/cytoscape-parent.git

工作?

2 个答案:

答案 0 :(得分:9)

export class User { // callback function has 2 arguments: err and user (you can specify their types too static findOne(query: any, cb: (err: any, user: any) => void) { // whatever } } 命令表示您要使用SSH URL进行克隆。 SSH URL通过SSH提供对Git存储库的访问,SSH是一种安全协议。要使用这些URL,您必须在计算机上生成SSH密钥对,并将公钥添加到您的GitHub帐户。通过此操作来设置SSH密钥对。 Generating an SSH key

答案 1 :(得分:1)

该脚本默认克隆SSH网址。设置SSH密钥已链接到另一个答案。您的另一种选择是:

  1. 更改脚本以克隆不需要此设置的HTTP网址。在您的特定情况下,您应该克隆https://github.com/cytoscape/cytoscape-parent.git
  2. 向项目发送修补程序以更改默认设置,使临时用户更容易克隆。