blob: 0c35f96972cfa5fdf47e9c2672297d935b812d6d [file] [log] [blame]
Lukas Fleischere2416252014-01-08 19:45:29 +01001cgit - CGI for Git
2==================
Lars Hjemli25105d72006-12-10 22:31:36 +01003
Lukas Fleischere2416252014-01-08 19:45:29 +01004This is an attempt to create a fast web interface for the Git SCM, using a
5built-in cache to decrease server I/O pressure.
Lars Hjemli25105d72006-12-10 22:31:36 +01006
Lars Hjemli66414b62007-01-28 13:18:23 +01007Installation
Lukas Fleischere2416252014-01-08 19:45:29 +01008------------
Lars Hjemli66414b62007-01-28 13:18:23 +01009
Lukas Fleischere2416252014-01-08 19:45:29 +010010Building cgit involves building a proper version of Git. How to do this
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020011depends on how you obtained the cgit sources:
12
13a) If you're working in a cloned cgit repository, you first need to
Lukas Fleischere2416252014-01-08 19:45:29 +010014initialize and update the Git submodule:
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020015
Lukas Fleischere2416252014-01-08 19:45:29 +010016 $ git submodule init # register the Git submodule in .git/config
17 $ $EDITOR .git/config # if you want to specify a different url for git
18 $ git submodule update # clone/fetch and checkout correct git version
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020019
20b) If you're building from a cgit tarball, you can download a proper git
21version like this:
22
Lukas Fleischere2416252014-01-08 19:45:29 +010023 $ make get-git
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020024
25When either a) or b) has been performed, you can build and install cgit like
26this:
27
Lukas Fleischere2416252014-01-08 19:45:29 +010028 $ make
29 $ sudo make install
Lars Hjemli5a217ed2007-05-11 12:13:15 +020030
Lukas Fleischere2416252014-01-08 19:45:29 +010031This will install `cgit.cgi` and `cgit.css` into `/var/www/htdocs/cgit`. You
32can configure this location (and a few other things) by providing a `cgit.conf`
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020033file (see the Makefile for details).
Lars Hjemli66414b62007-01-28 13:18:23 +010034
Lukas Fleischere2416252014-01-08 19:45:29 +010035Dependencies
36------------
Lars Hjemlic52e8412007-02-04 23:57:34 +010037
Lukas Fleischere2416252014-01-08 19:45:29 +010038* git 1.7.4
39* zip lib
40* crypto lib
41* openssl lib
Lars Hjemli5a217ed2007-05-11 12:13:15 +020042
43Apache configuration
Lukas Fleischere2416252014-01-08 19:45:29 +010044--------------------
Lars Hjemli5a217ed2007-05-11 12:13:15 +020045
Lukas Fleischere2416252014-01-08 19:45:29 +010046A new `Directory` section must probably be added for cgit, possibly something
Lars Hjemli5a217ed2007-05-11 12:13:15 +020047like this:
Lars Hjemlic52e8412007-02-04 23:57:34 +010048
Lukas Fleischere2416252014-01-08 19:45:29 +010049 <Directory "/var/www/htdocs/cgit/">
50 AllowOverride None
51 Options +ExecCGI
52 Order allow,deny
53 Allow from all
54 </Directory>
Lars Hjemli66414b62007-01-28 13:18:23 +010055
56
57Runtime configuration
Lukas Fleischere2416252014-01-08 19:45:29 +010058---------------------
Lars Hjemli66414b62007-01-28 13:18:23 +010059
Lukas Fleischere2416252014-01-08 19:45:29 +010060The file `/etc/cgitrc` is read by cgit before handling a request. In addition
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000061to runtime parameters, this file may also contain a list of repositories
Lukas Fleischere2416252014-01-08 19:45:29 +010062displayed by cgit (see `cgitrc.5.txt` for further details).
Lars Hjemli66414b62007-01-28 13:18:23 +010063
64The cache
Lukas Fleischere2416252014-01-08 19:45:29 +010065---------
Lars Hjemli66414b62007-01-28 13:18:23 +010066
Lukas Fleischere2416252014-01-08 19:45:29 +010067When cgit is invoked it looks for a cache file matching the request and
68returns it to the client. If no such cache file exists (or if it has expired),
69the content for the request is written into the proper cache file before the
Lars Hjemli66414b62007-01-28 13:18:23 +010070file is returned.
71
Lukas Fleischere2416252014-01-08 19:45:29 +010072If the cache file has expired but cgit is unable to obtain a lock for it, the
73stale cache file is returned to the client. This is done to favour page
Lars Hjemlidcef2572006-12-13 02:06:29 +010074throughput over page freshness.
Lars Hjemli25105d72006-12-10 22:31:36 +010075
Lars Hjemli66414b62007-01-28 13:18:23 +010076The generated content contains the complete response to the client, including
Lukas Fleischere2416252014-01-08 19:45:29 +010077the HTTP headers `Modified` and `Expires`.
Lars Hjemli5a217ed2007-05-11 12:13:15 +020078
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000079Online presence
Lukas Fleischere2416252014-01-08 19:45:29 +010080---------------
Lars Hjemli5a217ed2007-05-11 12:13:15 +020081
Jason A. Donenfeldcd42ded2013-05-27 21:56:57 +020082* The cgit homepage is hosted by cgit at <http://git.zx2c4.com/cgit/about/>
Lars Hjemli5a217ed2007-05-11 12:13:15 +020083
Lukas Fleischere2416252014-01-08 19:45:29 +010084* Patches, bug reports, discussions and support should go to the cgit
Jason A. Donenfeld72f89912013-05-13 14:00:50 +020085 mailing list: <cgit@lists.zx2c4.com>. To sign up, visit
86 <http://lists.zx2c4.com/mailman/listinfo/cgit>