【问题标题】:gitolite - how to clone and push to repo that's created under a "user" foldergitolite - 如何克隆并推送到在“用户”文件夹下创建的 repo
【发布时间】:2016-12-17 05:33:33
【问题描述】:

好吧,首先,我必须提前为自己是一个 git / gitolite noob 道歉。

现在好了..

问题

我的 git 服务器上有一个如下所示的文件夹:

mstgit:/var/git/repositories/user/johnd/tmp.git# ls
HEAD         branches     config       description  gl-creator   hooks        info         objects      refs
mstgit:/var/git/repositories/user/johnd/tmp.git# 

它在我们的网络界面(我猜是gitolite??)中显示为一个空文件夹。

我正在尝试使用以下命令克隆它:

localdev:/var/git/mystuff/projectX# git clone git@mastergit.fntx.net:user/johnd/tmp.git
Cloning into 'tmp'...
Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

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

我不明白为什么我的权限被拒绝。我在 git 服务器上创建了用户存储库。我使用与登录“localdev”框相同的 ssh 密钥登录服务器。

以下是 johnd 文件夹的文件权限,以防万一:

mstgit:/var/git/repositories/user/johnd/tmp.git# ls -lah
total 44
drwxr-sr-x    7 git      git         4.0K Dec 16 20:01 .
drwxr-sr-x    3 git      git         4.0K Dec 16 20:01 ..
-rw-r--r--    1 git      git           23 Dec 16 20:01 HEAD
drwxr-sr-x    2 git      git         4.0K Dec 16 20:01 branches
-rw-r--r--    1 git      git           66 Dec 16 20:01 config
-rw-r--r--    1 git      git           73 Dec 16 20:01 description
-rw-r--r--    1 git      git            5 Dec 16 20:01 gl-creator
drwxr-sr-x    2 git      git         4.0K Dec 16 20:01 hooks
drwxr-sr-x    2 git      git         4.0K Dec 16 20:01 info
drwxr-sr-x    4 git      git         4.0K Dec 16 20:01 objects
drwxr-sr-x    4 git      git         4.0K Dec 16 20:01 refs

此外,gl-creator 上的内容是“johnd”,这是我的 ssh id 名称。 不知道我还应该检查什么。

【问题讨论】:

    标签: git ssh gitolite


    【解决方案1】:

    如果您有权访问 gitolite-admin 存储库,you should check the access control rules

    您应该使用info command 检查您可以访问的内容。

    ssh git@host info
    

    您还可以在 gitolite 服务器端检查 ~git/.gitolite/logs 文件夹中的审核日志,其中将提及哪个规则拒绝了您的克隆。

    【讨论】:

      猜你喜欢
      • 2021-02-09
      • 2014-12-21
      • 2012-11-08
      • 2014-10-22
      • 1970-01-01
      • 2012-10-21
      • 2012-07-14
      • 2012-03-25
      • 2012-09-29
      相关资源
      最近更新 更多