gitolite + cgit: No repositories found
When browsing a directory using cgit I get the error:
No repositories found
When a new repository is created gitolite creates a corresponding directory to it under /home/git/repositories automagically. cgit is configuered to read these repositories using:
The problem is that these repositories doesn't seem to be bare repositories. If I instead manually clone one of these repositories using
git clone --bare user@server:repo
it seems to work. I really don't want to do this manually every time a new repository is checked in. Why aren't the repositories created by gitolite bare already? How can I automate this?
Turns out - after trying to verify it several times - this is just a file system rights issue. After trying
chown -R www-data:www-data repositories/repo
to force ownership into my apache user running cgit, the repository shows up in the web interface.
The proper solution is to add the apache user to the git group and change the value umask in .gitolite.rc to
It was similar with permission issue i encountered before. I used a scripts to fix permission of git repositories.
#!/bin/sh reponame="$1" if [ ! -d "$reponame" ]; then echo "missign repo_name" exit 1 fi find "$reponame" -type d | while read fn ; do chmod og+rx $fn ; echo "d-> $fn" ; done find "$reponame" -type f | while read fn ; do chmod og+r $fn ; echo "f-> $fn" ; done