4 When setting up a git.example.org server, there are several things to
5 configure to make everything work nicely together. All this is optional.
7 1. Run a git-daemon. This allows people to use a git:// URL to access your
8 repositories. This package provides the git-daemon program, to enable a
9 git-daemon service, configure inetd(8) to launch it on demand, or install the
10 git-daemon-run package to run it permanently:
11 cat >> /etc/inetd.conf <<EOF
12 git stream tcp4 nowait nobody /usr/bin/git git daemon --inetd --base-path=/var/lib /var/lib/git
13 git stream tcp6 nowait nobody /usr/bin/git git daemon --inetd --base-path=/var/lib /var/lib/git
17 apt-get install git-daemon-run
19 Wait five seconds for the service to be picked up, and check its status and
23 cat /var/log/git-daemon/current
25 The git daemon by default looks into the directory /var/lib/git/ for
26 repositories (this is configured in /etc/sv/git-daemon/run). It expects
27 the repositories' .git subdirectories in /var/lib/git/, symlinks pointing
28 to the corresponding subdirectories in the repositories are just fine, e.g.:
30 ln -s ~pape/git/foo/.git /var/lib/git/foo.git
32 Now git-clone git://git.example.org/git/repo will work.
34 2. Install rsync. This allows people to use rsync:// URLs to access your
35 repositories. You then need to add a stanza to /etc/rsyncd.conf that looks
42 Now git-clone rsync://git.example.org/git/repo will work.
44 3. Configure a web server for git. This allows people to use a http:// URL
45 to access your repositories.
47 Here's an example for an apache virtual server. Add a stanza to your apache
48 configuration that looks like this:
51 ServerName git.example.org
52 ServerAdmin webmaster@example.org
54 # bogus but safe DocumentRoot
55 DocumentRoot /var/lib/git
56 ErrorLog /var/log/apache2/git.example.org-error.log
57 CustomLog /var/log/apache2/git.example.org-access.log combined
58 Alias /robots.txt /var/www/cvs.robots.txt
59 Alias /static /usr/share/gitweb/static
60 Alias /git /var/lib/git
61 ScriptAlias / /usr/share/gitweb/gitweb.cgi
62 RedirectMatch permanent "^/~(.*)$" "http://example.org/~$1"
65 Now git clone http://git.example.org/git/repo will work. And if you
66 installed the gitweb package, http://git.example.org/ now will display a
67 list of repositories, making them accessible through a web browser.
69 -- Gerrit Pape <pape@smarden.org> Fri, 15 Sep 2006 09:19:37 +0000