How do I have to configure gitweb and gitolite so they'll work together?

后端 未结 3 754
自闭症患者
自闭症患者 2020-12-29 10:42

I am trying to make gitweb work with gitolite... but unsuccessful so far.
I am working on a RedHat Linux machine. A user called git exists.

gitolite

3条回答
  •  -上瘾入骨i
    2020-12-29 10:55

    1/ install gitolite and set it up. Then it suffices to make sure /home/git/.gitolite.rc contains uncommented parts that look like:

    %RC = (
        ...
        UMASK                           =>  0027,
        ...
        ENABLE => [
            ...
            'gitweb',
            ...
         ]
    );
    

    2/ set correctly $projectroot and $projects_list directives of /etc/gitweb.conf (to match location of projects.list file and repositories dir). Like:

    $projectroot = "/home/git/repositories";
    ...
    $projects_list = "/home/git/projects.list";
    

    3/ Make sure current repository files are also readable by webserver user. These examples are from debian based systems, so YMMV:

    sudo adduser www-data git                   # append `www-data` user to a `git` group
    sudo chmod g+r /home/git/projects.list      # make sure group members can read the `project.list`
    sudo chmod -R g+rx /home/git/repositories   # recursively set less restrictive access mode for group members
    sudo /etc/init.d/apache2 restart            # restart web server to apply these changes
    

    4/ Finally configure access for gitweb user within your /conf/gitolite.conf file of gitolite-admin repository on a client machine and apply them by committing and pushing them (the standard way). A repository we would like to see and manage via gitweb has to have the access set like this:

    repo testing                                                                    
        RW+     = @all                                                              
        R       = gitweb  # add this line to make the repo browsable using `gitweb`
    

    Note: The ... only suggests there are other configuration directives within the files. Do not put them there!

    No other chages are necessary to make gitlab visualize the gitolite repositories.

    Applies (at least) for gitolite 3.6.6 and gitweb 2.1.4

提交回复
热议问题