我正在尝试运行git服务器存储库。
我确实安装了gitolite

当通过SSH运行git info时服务器回答

ssh git@myserver info

hello Brian, this is git@hepide01pep1 running gitolite3  on git 1.6.3.2
R W   testing

尝试克隆gitolite-admin存储库时,出现以下错误
git clone git@myserver:gitolite-admin

Cloning into 'gitolite-admin'...
FATAL: R any gitolite-admin Brian DENIED by fallthru
(or you mis-spelled the reponame)
fatal: The remote end hung up unexpectedly

这种语法也会发生同样的事情
git clone ssh://git@myserver/gitolite-admin
Cloning into 'gitolite-admin'...
FATAL: R any gitolite-admin Brian DENIED by fallthru
(or you mis-spelled the reponame)
fatal: The remote end hung up unexpectedly

有人能给我一些有用的提示吗?我在此处和网络上查看了答案,但没有找到任何对我有帮助的东西。

最佳答案

只能使用以用于gitolite服务器的git帐户命名的公用 key 访问gitolite-admin

默认情况下,您使用的是brian.pub,它仅使您可以访问testing.git存储库。

您需要在本地工作站上定义一个$HOME/.ssh/config文件,以便记录ssh参数以使用正确的键。
参见“gitolite: can connect via ssh, can't clone”。

~/.ssh/gitolite.pub
~/.ssh/gitolite


host gitolite
     user git # replace it by the actual git user for the gitolite server
     hostname server.com
     identityfile ~/.ssh/gitolite

该克隆将起作用:
git clone gitolite:gitolite-admin

OP macbert确认:


Cloning into 'gitolite-admin'...
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 15 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (15/15), done.

因此,使用正确的默认 key ,此时ssh git@myserver info应该在“hello”消息中显示对gitolite-admin repo的正确访问。

关于git clone git @ myserver :gitolite-admin fails,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12617672/

10-13 07:29