January 27, 2011

git, cgit and mini_httpd

 git allows very easy local installation. We need a easy way to view the local git repository. mini_httpd is a great local web server to use, and git web app can either be "gitweb" or "cgit".

I tried "gitweb" but couldn't get it to see my projects. But I got "cgit" to work well. Here is how:

1. download and compile cgit. very simple, just follow the README file.
2. change cgit Makefile, "CGIT_CONFIG = /yourpath/cgitrc", then "touch cgit.c" and "make" again. We do this because by default cgitrc is located at /etc/ and we want it local.
3. Create your cgitrc file from the example file. I use something like this:

cache-size=0
css=/cgit.css
enable-index-links=1
enable-log-filecount=1
enable-log-linecount=1
max-stats=quarter
root-title=My git repository
root-desc=Tracking my project development
root-readme=about.html
snapshots=tar.gz
mimetype.git=image/git
mimetype.html=text/html
mimetype.jpg=image/jpeg
mimetype.jpeg=image/jpeg
mimetype.pdf=application/pdf
mimetype.png=image/png
mimetype.svg=image/svg+xml
repo.url=linux
repo.path=/opt/gittest/.git
repo.desc=My project
repo.owner=me@me.com
repo.readme=info/web/about.html
repo.snapshots=tar.gz
repo.enable-log-linecount=0
repo.max-stats=month

4. start minihttpd and your are in business. :-)

1 comment:

  1. Hi, is there anything special you had to do with mini_httpd got get cgit to work? Did you do sub-domain or path in URL?

    ReplyDelete