无法克隆Gerrit存储库

时间:2015-03-14 08:57:13

标签: git gerrit git-bash

我正在尝试连接到我的VPS上托管的gerrit。我正在使用Git Bash for windows。我在GitBash中使用ssh-keygen生成了SSH密钥,并在gerrit服务器上添加了密钥。 当我运行ssh -p 29418 <username>@<gerrit-server>时,我会看到以下欢迎信息

  ****    Welcome to Gerrit Code Review    ****

  Hi Full Name, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://username@<gerrit-server>:29418/REPOSITORY_NAME.git

但是当我通过运行以下命令克隆存储库时

git clone ssh://<username>@<gerrit-server>:29418/project-name.git

我在Git Bash终端中看到以下错误

Cloning into 'project-name'...
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我无法理解发生了什么以及如何在我的机器中成功克隆我的项目。有人可以帮我解决这个问题吗?

更新-1:

我仍然无法弄清楚问题是什么,但我只想分享一些现在正在发生的奇怪事情。我创建了另一个SSH密钥,这次我为SSH密钥添加了密码。我也在SSH服务器上添加了该密钥。通常当密钥附加密码短语时,Git Bash终端应该要求密码短语解锁私钥。
现在发生的事情是,如果我通过运行命令
ssh -p 29418 <username>@<gerrit-server> ssh gerrit服务器,它要求我解密密码,这意味着它使用正确的ssh密钥并显示Gerrit欢迎消息

1 个答案:

答案 0 :(得分:0)

配置您的git设置 - &gt;配置

添加用户名和电子邮件(在gerrit设置中使用)