I am trying to use Gitolite + Gitweb but I am running into some problems..
My conf/gitolite.conf
is the following
@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
When I first inserted repository code1 and code2, git told me:
remote: Initialized empty Git repository in /home/git/repositories/code1.git/
remote: Initialized empty Git repository in /home/git/repositories/code2.git/
I did an initial commit on code2 but it didn't show up. So I checked the permission and I found that these were:
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/
So I fixed permission for repo code1.git
and code2.git
with:
# 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 {} \;
The two repos showed up on gitweb interface.
However, gl-conf
for each of these two repos was not generated.
Now, doing a commit, permissions are messed up again, and repos are not showing..
What am I doing wrong?
Thanks
Reading from this question I PARTIALLY solved it like this:
Initially, gitweb doesn't have any permissions to read the repository, so we fix the problem by adding the gitweb user (usually
www-data
orapache
) to the git group by runningusermod -a -G git www-data
(be aware of your server's configuration, because that can be a little different, according to how you configuratedgitolite
.Change the
UMASK
property on the.gitolite.rc
file (present in git user home directory), from the default value of0077
to0022
, the equivalent of755 (rwxr-xr-x)
for directories and644 (rw-r--r--)
for files.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?
also, if rights are ok, you should check which dir is scan for gitweb and where put gitolite repos, it can be different and symlinks makes new repos visible.
来源:https://stackoverflow.com/questions/19122319/gitweb-not-displaying-some-repos