3

我按照这个步骤配置:http ://sitaramc.github.com/gitolite/ggshb.html

但是当我尝试制作一个 git clone 时,我遇到了这个错误:

git clone http://guillaume@git.domain.net/gitolite-admin
Initialized empty Git repository in /home/guidtz/tmp/tmp/gitolite-admin/.git/
Password: 
fatal: http://guillaume@git.domain.net/gitolite-admin/info/refs not found: did you run git update-server-info on the server?

我完成了 git update-server-info。

我将 http 配置放在 repos/config 中:

[http]
      receivepack = true

info/refs文件存在

我的 apache 虚拟主机:

<VirtualHost *:80>
   ServerName git.domain.net
   ServerAdmin sysadmin@domain.net

   LogLevel debug
   ErrorLog "|/usr/bin/cronolog /var/log/apache2/git/%Y/%W/%d-error.log"
   CustomLog "|/usr/bin/cronolog /var/log/apache2/git/%Y/%W/%d-access.log" combined

   DocumentRoot /var/www/gitweb

   SuexecUserGroup gitolite gitolite

   SetEnv GIT_PROJECT_ROOT /home/git/repositories
   SetEnv GIT_HTTP_EXPORT_ALL
   SetEnv GITOLITE_HTTP_HOME /home/git

   ScriptAliasMatch "(?x)^/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}\.(pack|idx)) | git-(upload|receive)-pack))$" /var/www/bin/gitolite-suexec-wrapper.sh/$1
  <Directory "/var/www/gitweb">
            Options ExecCGI
            AllowOverride None
            AddHandler cgi-script .cgi
            DirectoryIndex gitweb.cgi
            Order allow,deny
            Allow from all
   </Directory>
   <Directory "/var/www/bin">
            <Files "gitolite-suexec-wrapper.sh">
                    Order allow,deny
                    Allow from all
            </Files>
   </Directory>

   <Location / >
           AuthType Basic
           AuthName "Private Git Access"
           AuthUserFile /etc/apache2/gitusers
           Require valid-user
   </Location>
</VirtualHost>

我的包装文件/var/www/bin/gitolite-suexec-wrapper.sh

#!/bin/bash
#
# Wrapper for gl-auth-command
#

USER=$1

export GIT_PROJECT_ROOT="/home/git/repositories"
export GITOLITE_HTTP_HOME="/home/git"

exec  /home/git/bin/gl-auth-command $USER

# End
4

1 回答 1

2

我发现了我的错误,我忘记/

Directory "/var/www/bin">

我不得不添加一个空文件git-daemon-export-ok

所以当我推。Gitolitegit-daemon-export-ok仅在gitolite-admin项目中删除,而不是在所有其他项目中。

于 2011-11-30T01:59:44.483 回答