Gitweb不显示一些仓库 [英] Gitweb not displaying some repos

查看:269
本文介绍了Gitweb不显示一些仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Gitolite + Gitweb,但是遇到了一些问题.

我的conf/gitolite.conf是以下

@dataset_repos      = dat1 dat2
@closedsrc_repos    = cod1 cod2 
@opensrc_repos      = testing

@admins             = user1 user2
@bios               = user1 user2 user3
@coders             = user1 user3

repo gitolite-admin
    RW+     =   @admins

repo @opensrc_repos
    RW+     =   @all

repo @dataset_repos
    RW+     =   @admins @bios 

repo @closedsrc_repos
    RW+     =   @admins @coders

当我第一次插入存储库代码1和代码2时,git告诉我:

remote: Initialized empty Git repository in /home/git/repositories/code1.git/
remote: Initialized empty Git repository in /home/git/repositories/code2.git/

我对code2进行了初始提交,但未显示. 所以我检查了许可,发现它们是:

drwxrwx--- 8 git git 4096 Oct  1 18:58 ./
drwxr-xr-x 8 git git 4096 Oct  1 19:08 ../
drwxrwx--- 8 git git 4096 Oct  1 19:08 gitolite-admin.git/
drwxrws--- 7 git git 4096 Oct  1 17:15 dat1.git/
drwx------ 7 git git 4096 Oct  1 18:58 code1.git/
drwx------ 7 git git 4096 Oct  1 18:58 code2.git/
drwxrwx--- 7 git git 4096 Sep 30 18:20 testing.git/
drwxrws--- 7 git git 4096 Oct  1 17:15 dat2.git/

所以我通过以下方式固定了回购code1.gitcode2.git的权限:

# Fix ownership
sudo chown -R git:git *

# Fix directory permissions
sudo find <repo.git> -type d -exec chmod 770 {} \;

# Fix file permissions
sudo find <repo.git> -type f -exec chmod 660 {} \;

这两个仓库显示在gitweb界面上. 但是,没有为这两个存储库中的每一个生成gl-conf. 现在,进行一次提交,权限又被弄乱了,存储库也没有显示出来.

我在做什么错了?

谢谢

解决方案

解决方案

Reading from this question I PARTIALLY solved it like this:

  1. Initially, gitweb doesn't have any permissions to read the repository, so we fix the problem by adding the gitweb user (usually www-data or apache) to the git group by running usermod -a -G git www-data (be aware of your server's configuration, because that can be a little different, according to how you configurated gitolite.

  2. Change the UMASK property on the .gitolite.rc file (present in git user home directory), from the default value of 0077 to 0022, the equivalent of 755 (rwxr-xr-x) for directories and 644 (rw-r--r--) for files.

  3. For existing repos, you might need to run a chmod -R g+rX

More infos on link above.

Anyway, every time I edit gitolite-admin repo, this shows up in the list of present repositories.. How to change it?

这篇关于Gitweb不显示一些仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆