【发布时间】:2020-09-28 18:32:37
【问题描述】:
我最近在一个 ubuntu 18.04 LTS 实例上安装了 gitlab。我正在尝试从 GitLab 克隆一个 repo。 我的 ssh 配置文件如下:
# ~/.ssh/config
User git
Hostname gitlab.com
IdentityFile ~/.ssh/id_ed25519
TCPKeepAlive yes
IdentitiesOnly yes
我已将 ed25519 公钥添加到 GitLab 中的 SSH 密钥中。当我尝试克隆存储库时,我遇到了这个问题-
$ git clone git@xxxx:root/test-project.git
Cloning into 'test-project'...
kex_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我做错了什么?我检查了互联网上的几个链接,但我无法弄清楚我做错了什么。
如果我使用 http 而不是 ssh,我可以克隆和推送。
git clone http://xxxx/root/test-project.git
Cloning into 'test-project'...
warning: You appear to have cloned an empty repository.
为什么 http 可以工作而不是 ssh?
【问题讨论】:
-
我已经在这里回答了:stackoverflow.com/a/64100419/3437897