【发布时间】:2020-03-23 07:49:29
【问题描述】:
我的问题是我想将 Google Colab 实例与 Gitlab 项目连接起来,但 SSH 和 HTTPS 似乎都不起作用。从错误消息中,我怀疑 Colab 中存在与设置相关的问题。也许我必须允许 Colab 连接到 Gitlab 并将其放在某处的白名单中?
在位于“/content”目录中时,从 Colab 中的 Notebook 运行以下 shell 命令
git config --global user.name "mr_bla"
git config --global user.email "bla@wbla.bla"
git clone https://gitlab.com/mr_bla/mr_blas_project.git
导致以下错误消息:
Cloning into 'mr_blas_project'...
fatal: could not read Username for 'https://gitlab.com': No such device or address
我已经按照习惯生成了 SSH 密钥,但是 SSH 检查
ssh -vvvT git@gitlab.com:mr_bla/mr_blas_project.git
失败,导致以下错误:
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "gitlab.com:mr_bla/mr_blas_project.git" port 22
ssh: Could not resolve hostname gitlab.com:mr_bla/mr_blas_project.git: Name or service not known
尝试使用 SSH 方式克隆项目也不起作用:
git clone git@gitlab.com:mr_bla/mr_blas_project.git
结果:
Cloning into 'mr_blas_project'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Google Colab 实例正在运行以下操作系统:
cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
我已经检查了以下问题,但没有成功:
【问题讨论】:
-
嗨,你能把你的 colab 和 gitlab 连接起来吗?我想在 gitlab 上上传我的 colab 文件!谢谢
-
嗨@Chris_007,不抱歉,我最终将项目写在一个普通的 .py 文件中并在本地运行所有内容。如果您的存储库不需要是私有的,也许您可以尝试 mitra 的答案并将您的 GitLab 存储库公开。并考虑在 SSH 和 HTTPS 之间切换。
标签: git gitlab google-colaboratory