6 git-http-backend - Server side implementation of Git over HTTP
15 A simple CGI program to serve the contents of a Git repository to Git
16 clients accessing the repository over http:// and https:// protocols.
18 By default, only the `upload-pack` service is enabled, which serves
19 'git-fetch-pack' and 'git-ls-remote' clients, which are invoked from
20 'git-fetch', 'git-pull', and 'git-clone'.
22 This is ideally suited for read-only updates, i.e., pulling from
27 'git-http-backend' relies on the invoking web server to perform
28 URL to path translation, and store the repository path into the
29 PATH_TRANSLATED environment variable. Most web servers will do
30 this translation automatically, resolving the suffix after the
31 CGI name relative to the server's document root.
37 To serve all Git repositories contained within the '/git/'
38 subdirectory of the DocumentRoot, ensure mod_cgi and
39 mod_alias are enabled, and create a ScriptAlias to the CGI:
41 ----------------------------------------------------------------
42 ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/git/
44 <Directory /usr/libexec/git-core>
47 <Files /usr/libexec/git-core/git-http-backend>
50 ----------------------------------------------------------------
52 To require authentication for reads, use a Directory
53 directive around the repository, or one of its parent directories:
55 ----------------------------------------------------------------
56 <Directory /var/www/git/private>
58 AuthName "Private Git Access"
59 Require group committers
62 ----------------------------------------------------------------
64 Accelerated static Apache 2.x::
65 Similar to the above, but Apache can be used to return static
66 files that are stored on disk. On many systems this may
67 be more efficient as Apache can ask the kernel to copy the
68 file contents from the file system directly to the network:
70 ----------------------------------------------------------------
73 ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/git/
74 Alias /git_static/ /var/www/git/
77 RewriteRule ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /git_static/$1 [PT]
78 RewriteRule ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.pack)$ /git_static/$1 [PT]
79 RewriteRule ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.idx)$ /git_static/$1 [PT]
80 ----------------------------------------------------------------
85 'git-http-backend' relies upon the CGI environment variables set
86 by the invoking web server, including:
97 Written by Shawn O. Pearce <spearce@spearce.org>.
101 Documentation by Shawn O. Pearce <spearce@spearce.org>.
105 Part of the linkgit:git[1] suite