1

我在服务器 A 上设置了 gitolite,我完全能够从本地机器克隆存储库。

user@localmachine:$ git clone git@A:repo.git

不过,我无法从服务器 B 克隆相同的存储库

user@B:$ git clone git@A:repo.git
Cloning into 'repo'...
R access for repo DENIED to user
(Or there may be no repository at the given path. Did you spell it correctly?)
fatal: The remote end hung up unexpectedly

我在 ~/.ssh/config 中激活了 ForwardAgent,并且 ssh-add -l 在本地机器和服务器 B 上给了我完全相同的输出。

有谁知道这可以解释什么?

4

1 回答 1

0

OP user2819697在评论中提到的错误之前已经看到过:

我忘了删除我使用的条目,对Ain/etc/hosts进行了一些测试B

您可以在此设置中看到 Jenkins 和 Gitolite 的 /etc/hosts 配置:

如果 gitolite 和 jenkins 都托管在同一个 IP 上,您接下来要在 jenkins 服务器上的 git 存储库的 /etc/hosts 中添加一个条目。

 hesco@pbx:/var/lib/jenkins$ sudo vim /etc/hosts
127.0.0.1       git.example.com git

因此,如果有任何B /etc/hosts引用A...这将无法正常工作。

于 2013-10-04T12:06:41.683 回答