我正在尝试使用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.git
和code2.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
。
现在,进行提交,权限再次搞砸了,并且repos没有显示..
我做错了什么?
由于
答案 0 :(得分:1)
从this question阅读我部分地解决了这个问题:
最初,gitweb没有任何权限来读取存储库,因此我们通过运行gitweb用户(通常是www-data
或apache
)来添加git组来解决问题usermod -a -G git www-data
(请注意您的服务器配置,因为根据您配置gitolite
的方式,这可能会略有不同。
将UMASK
文件(存在于git用户主目录中)的.gitolite.rc
属性更改为默认值0077
至0022
,等效项目录为755 (rwxr-xr-x)
,文件为644 (rw-r--r--)
。
对于现有的回购,您可能需要运行chmod -R g+rX
以上链接的更多信息。
无论如何,每当我编辑gitolite-admin
repo时,它都显示在当前存储库的列表中。如何更改它?
答案 1 :(得分:0)
另外,如果权利还可以,你应该检查哪个dir扫描gitweb以及gitolite repos放在哪里,它可以是不同的,符号链接使新的repos可见。