I have a functioning git repository on my CentOs 5.5 server. I want a web user interface for my repositories using gitweb.
I installed gitweb using the instructions at http://git-scm.com/book/ch4-6.html and I manage to have my apache server to run the cgi properly. I put my repositories in /pub/git
and created the gitweb.conf
file in /etc/
with the line $projectroot = '/pub/git';
. Unfortunately, I can't see my repositories and the webpage shows the message "No such projects found", which I googled without success.
I tried to add the line $projects_list = '/pub/git/projects.list';
to the gitweb.conf
and created the file projects.list
with the name of my repositories (e.g. repos1.git
). Nothing changes. If I put the name of a repository that does not exist in /pub/git
, the webpage shows the more popular and investigated error message "404 - No projects found".
Notice that the apache user can access all the files and repositories.
The content of my /etc/gitweb.conf
is:
$projectroot = '/pub/git';
$projects_list = '/pub/git/projects.list';
Thanks!
I solved my own problem, and I thought I would post the solution in case someone else comes across this.
It turns out that gitweb could simply not find the git
executable. In other words, the make instructions make GITWEB_PROJECTROOT="/path/to/git/git"
shown in http://git-scm.com/book/ch4-6.html is not sufficient.
The reason why it took me so long to figure this out is because one would expect another type of problem coming up, not just an empty list of repositories! It seems like in order to show the latest commit message gitweb runs git rev-list
on the project. When it can't find git
, it simply gives up on listing the projects. All I had to do was adding the line $GIT = '/path/to/git/git';
to my gitweb.conf
.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With