path: root/Documentation/git-http-backend.txt
diff options
authorShawn O. Pearce <>2009-10-31 00:47:34 (GMT)
committerJunio C Hamano <>2009-11-05 01:58:15 (GMT)
commit556cfa3b6d316074d41cd73c4659402fdb6207c8 (patch)
tree70de4c0f563493dc05f2f53b3af554657f99f9eb /Documentation/git-http-backend.txt
parent42526b478e369d7e8c9a95186ad87fae9930eea5 (diff)
Smart fetch and push over HTTP: server side
Requests for $GIT_URL/git-receive-pack and $GIT_URL/git-upload-pack are forwarded to the corresponding backend process by directly executing it and leaving stdin and stdout connected to the invoking web server. Prior to starting the backend process the HTTP response headers are sent, thereby freeing the backend from needing to know about the HTTP protocol. Requests that are encoded with Content-Encoding: gzip are automatically inflated before being streamed into the backend. This is primarily useful for the git-upload-pack backend, which receives highly repetitive text data from clients that easily compresses to 50% of its original size. Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-http-backend.txt')
1 files changed, 38 insertions, 1 deletions
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 867675f..022a243 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -22,6 +22,23 @@ By default, only the `upload-pack` service is enabled, which serves
This is ideally suited for read-only updates, i.e., pulling from
git repositories.
+These services can be enabled/disabled using the per-repository
+configuration file:
+ This serves 'git-fetch-pack' and 'git-ls-remote' clients.
+ It is enabled by default, but a repository can disable it
+ by setting this configuration item to `false`.
+ This serves 'git-send-pack' clients, allowing push. It is
+ disabled by default for anonymous users, and enabled by
+ default for users authenticated by the web server. It can be
+ disabled by setting this item to `false`, or enabled for all
+ users, including anonymous users, by setting it to `true`.
'git-http-backend' relies on the invoking web server to perform
@@ -49,7 +66,19 @@ ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/git/
-To require authentication for reads, use a Directory
+To enable anonymous read access but authenticated write access,
+require authorization with a LocationMatch directive:
+<LocationMatch ".*/git-receive-pack$">
+ AuthType Basic
+ AuthName "Git Access"
+ Require group committers
+ ...
+To require authentication for both reads and writes, use a Directory
directive around the repository, or one of its parent directories:
@@ -92,6 +121,14 @@ by the invoking web server, including:
+The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' and
+ensuring that any reflogs created by 'git-receive-pack' contain some
+identifying information of the remote user who performed the push.
+All CGI environment variables are available to each of the hooks
+invoked by the 'git-receive-pack'.
Written by Shawn O. Pearce <>.