Cgit

cgit is fast web interface for the git. cgit has built a cache and is compiled in c so it's very quick.

To start out, download the current version of cgit via git git clone git://git.zx2c4.com/cgit Next you need to setup the git submodule cd cgit git submodule init git submodule update Then compile the software make And install it make install mkdir -p /var/cache/cgit chown apache:apache /var/cache/cgit After you have installed cgit, you will need to setup Apache to run cgit. This is pretty easy, just edit your /etc/httpd/conf/httpd.conf file and add the following for the site you wish to run cgit on.

 AllowOverride None Options ExecCGI Order allow,deny Allow from all 

Or you may try my quick setup mkdir -p /var/src cd /var/src/ rm -rf cgit git clone git://hjemli.net/pub/git/cgit cd cgit git submodule init git submodule update sed -i 's/CGIT_CONFIG = \/etc\/cgitrc/CGIT_CONFIG = \/var\/www\/code.mattrude.com\/cgitrc/g' Makefile sed -i 's/CGIT_SCRIPT_PATH = \/var\/www\/htdocs\/cgit/CGIT_CONFIG = \/var\/www\/code.mattrude.com\/cgit/g' Makefile make && make install mkdir -p /var/cache/cgit chown nginx:nginx /var/cache/cgit Or apt-get -y install gcc make libcurl4-openssl-dev mkdir -p /var/src && cd /var/src && rm -rf cgit && git clone git://hjemli.net/pub/git/cgit && cd cgit && \ git submodule init && git submodule update && \ sed -i 's/CGIT_CONFIG = \/etc\/cgitrc/CGIT_CONFIG = \/var\/www\/code.mattrude.com\/cgitrc/g' Makefile && \ sed -i 's/CGIT_SCRIPT_PATH = \/var\/www\/htdocs\/cgit/CGIT_SCRIPT_PATH = \/var\/www\/code.mattrude.com/g' Makefile && \ make && make install && mkdir -p /var/cache/cgit

Config file
Once your done setting up cgit in Apache, you may configure cgit by creating a cgitrc file at /etc/cgitrc. Below is the example config file.

EXAMPLE CGITRC FILE --- cache-size=1000 clone-prefix=git://foobar.com ssh://foobar.com/pub/git http://foobar.com/git css=/css/cgit.css enable-index-links=1 enable-log-filecount=1 enable-log-linecount=1 favicon=/favicon.ico logo=/img/mylogo.png max-stats=quarter root-title=foobar.com git repositories root-desc=tracking the foobar development root-readme=/var/www/htdocs/about.html snapshots=tar.gz tar.bz2 zip ## ## 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=foo repo.path=/pub/git/foo.git repo.desc=the master foo repository repo.owner=fooman@foobar.com repo.readme=info/web/about.html repo.url=bar repo.path=/pub/git/bar.git repo.desc=the bars for your foo repo.owner=barman@foobar.com repo.readme=info/web/about.html section=extras repo.url=baz repo.path=/pub/git/baz.git repo.desc=a set of extensions for bar users repo.url=wiz repo.path=/pub/git/wiz.git repo.desc=the wizard of foo section=mirrors repo.url=git repo.path=/pub/git/git.git repo.desc=the dscm repo.url=linux repo.path=/pub/git/linux.git repo.desc=the kernel repo.snapshots=0 repo.enable-log-linecount=0 repo.max-stats=month
 * 1) Enable caching of up to 1000 output entriess
 * 1) Specify some default clone prefixes
 * 1) Specify the css url
 * 1) Show extra links for each repository on the index page
 * 1) Show number of affected files per commit on the log pages
 * 1) Show number of added/removed lines per commit on the log pages
 * 1) Add a cgit favicon
 * 1) Use a custom logo
 * 1) Enable statistics per week, month and quarter
 * 1) Set the title and heading of the repository index page
 * 1) Set a subheading for the repository index page
 * 1) Include some more info about foobar.com on the index page
 * 1) Allow download of tar.gz, tar.bz2 and zip-files
 * 1) List of common mimetypes
 * 1) List of repositories.
 * 2) PS: Any repositories listed when section is unset will not be
 * 3)     displayed under a section heading
 * 4) PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
 * 5)      and included like this:
 * 6)        include=/etc/cgitrepos
 * 1) The next repositories will be displayed under the 'extras' heading
 * 1) Add some mirrored repositories
 * 1) Disable adhoc downloads of this repo
 * 1) Disable line-counts for this repo
 * 1) Restrict the max statistics period for this repo

Configuring CGIT on Apache
 ServerName code.example.com DocumentRoot /var/www/code.example.com SetEnv CGIT_CONFIG         /var/www/code.example.com/cgitrc Alias /cgit.css            /var/www/code.example.com/cgit.css Alias /mattrude.png        /var/www/code.example.com/cgit.png Alias /favicon.ico         /var/www/code.example.com/favicon.ico Alias /robots.txt          /var/www/code.example.com/robots.txt Alias /                    /var/www/code.example.com/cgit.cgi/       ExpiresActive On       ExpiresByType image/png "access plus 6 month" ExpiresByType image/ico "access plus 6 month" ExpiresByType text/css "access plus 6 month"        SetOutputFilter DEFLATE # Don't compress SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary #Dealing with proxy servers         Header append Vary User-Agent    Options Indexes FollowSymLinks Options +ExecCGI Order allow,deny Allow from all AddHandler cgi-script .cgi DirectoryIndex cgit.cgi  