在Google Colaboratory上向终端回答“是”

时间:2018-02-09 15:52:32

标签: python github google-colaboratory

我正在尝试使用Google Colaboratory从Github克隆,我正在使用的命令是:

!git clone git@github.com:CliMT/climt.git

但我得到以下内容:

Cloning into 'climt'...
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?

但由于这是Google Colaboratory,我不能在终端上输入“是”。

我该怎么办?

谢谢!

2 个答案:

答案 0 :(得分:1)

如果您只需要公共读取权限,则可以使用https替换SSH访问: !git clone https://github.com/CliMT/climt.git

如果你正在使用SSH,因为你有计划从colaboratory运行时写入github repo,那么你必须手动设置SSH密钥和可能的known_hosts文件。 或脚本打字"是"使用像https://pexpect.readthedocs.io/en/stable/

这样的东西

(FTR注意警告不是特定于实验室的:https://help.github.com/articles/testing-your-ssh-connection/

答案 1 :(得分:0)

错误:

!git clone git@github.com:CliMT/climt.git

在jupyter笔记本中使用:

!git clone https://github.com/CliMT/climt.git
相关问题