【问题标题】:Gitweb not displaying some reposGitweb没有显示一些回购
【发布时间】:2013-10-07 23:23:55
【问题描述】:

我正在尝试使用 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

当我第一次插入存储库code1和code2时,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/

所以我修复了 repo 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 {} \;

这两个 repos 出现在 gitweb 界面上。 但是,没有为这两个存储库中的每一个生成gl-conf。 现在,做一个提交,权限又搞砸了,repos 没有显示..

我做错了什么?

谢谢

【问题讨论】:

    标签: git permissions repository gitolite gitweb


    【解决方案1】:

    this question 阅读,我部分解决了这个问题:

    1. 最初,gitweb 没有任何权限读取存储库,所以我们通过运行usermod -a -G git www-data(请注意您的服务器配置,因为根据您配置gitolite 的方式,可能会有所不同。

    2. .gitolite.rc 文件(存在于 git 用户主目录中)上的 UMASK 属性从默认值 0077 更改为 0022,相当于目录的 755 (rwxr-xr-x) 和 @ 987654331@ 用于文件。

    3. 对于现有的存储库,您可能需要运行 chmod -R g+rX

    以上链接的更多信息。

    无论如何,每次我编辑gitolite-admin repo 时,它都会显示在当前存储库列表中。如何更改它?

    【讨论】:

      【解决方案2】:

      另外,如果权限没问题,您应该检查哪个目录是扫描 gitweb 以及放置 gitolite 存储库的位置,它可以不同并且符号链接使新存储库可见。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-05-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-03-12
        • 2016-07-19
        • 1970-01-01
        相关资源
        最近更新 更多