1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.2.5" />
7 <style type=
"text/css">
9 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
11 border: 1px solid red;
16 margin: 1em 5% 1em 5%;
21 text-decoration: underline
;
39 h1
, h2
, h3
, h4
, h5
, h6
{
41 font-family: sans-serif
;
48 border-bottom: 2px solid silver
;
66 border: 1px solid silver
;
81 font-family: sans-serif
;
88 font-family: sans-serif
;
92 font-family: sans-serif
;
94 border-top: 2px solid silver
;
100 padding-bottom: 0.5em;
104 padding-bottom: 0.5em;
108 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
109 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
110 div
.admonitionblock
{
113 margin-bottom: 1.5em;
115 div
.admonitionblock
{
117 margin-bottom: 2.5em;
120 div
.content
{ /* Block element content. */
124 /* Block element titles. */
125 div
.title
, caption
.title
{
126 font-family: sans-serif
;
130 margin-bottom: 0.5em;
136 td div
.title:first-child
{
139 div
.content div
.title:first-child
{
142 div
.content
+ div
.title
{
146 div
.sidebarblock
> div
.content
{
148 border: 1px solid silver
;
155 div
.listingblock
> div
.content
{
156 border: 1px solid silver
;
161 div
.quoteblock
> div
.content
{
168 div
.verseblock
+ div
.attribution
{
172 div
.admonitionblock
.icon
{
176 text-decoration: underline
;
178 padding-right: 0.5em;
180 div
.admonitionblock td
.content
{
182 border-left: 2px solid silver
;
185 div
.exampleblock
> div
.content
{
186 border-left: 2px solid silver
;
190 div
.verseblock div
.content
{
194 div
.imageblock div
.content
{ padding-left: 0; }
195 div
.imageblock img
{ border: 1px solid silver
; }
196 span
.image img
{ border-style: none
; }
200 margin-bottom: 0.8em;
212 list-style-position: outside
;
215 list-style-type: lower-alpha
;
218 div
.tableblock
> table
{
219 border: 3px solid
#527bbd;
222 font-family: sans-serif
;
231 margin-bottom: 0.8em;
239 padding-right: 0.8em;
246 div#footer-badges
{ display: none
; }
251 font-family: sans-serif
;
255 margin-bottom: 0.1em;
258 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
274 include1::./stylesheets
/xhtml11-manpage
.css
[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div
.sidebar-content
{
279 border: 1px solid silver
;
282 div
.sidebar-title
, div
.image-title
{
283 font-family: sans-serif
;
286 margin-bottom: 0.5em;
289 div
.listingblock div
.content
{
290 border: 1px solid silver
;
295 div
.quoteblock-content
{
299 div
.exampleblock-content
{
300 border-left: 2px solid silver
;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc
a:visited
{ color: blue
; }
307 <title>git-http-backend(
1)
</title>
312 git-http-backend(
1) Manual Page
315 <div class=
"sectionbody">
316 <p>git-http-backend -
317 Server side implementation of Git over HTTP
322 <div class=
"sectionbody">
323 <div class=
"verseblock">
324 <div class=
"content"><em>git http-backend
</em></div></div>
326 <h2 id=
"_description">DESCRIPTION
</h2>
327 <div class=
"sectionbody">
328 <div class=
"para"><p>A simple CGI program to serve the contents of a Git repository to Git
329 clients accessing the repository over http:// and https:// protocols.
330 The program supports clients fetching using both the smart HTTP protocol
331 and the backwards-compatible dumb HTTP protocol, as well as clients
332 pushing using the smart HTTP protocol.
</p></div>
333 <div class=
"para"><p>It verifies that the directory has the magic file
334 "git-daemon-export-ok", and it will refuse to export any git directory
335 that hasn't explicitly been marked for export this way (unless the
336 GIT_HTTP_EXPORT_ALL environmental variable is set).
</p></div>
337 <div class=
"para"><p>By default, only the
<tt>upload-pack
</tt> service is enabled, which serves
338 <em>git fetch-pack
</em> and
<em>git ls-remote
</em> clients, which are invoked from
339 <em>git fetch
</em>,
<em>git pull
</em>, and
<em>git clone
</em>. If the client is authenticated,
340 the
<tt>receive-pack
</tt> service is enabled, which serves
<em>git send-pack
</em>
341 clients, which is invoked from
<em>git push
</em>.
</p></div>
343 <h2 id=
"_services">SERVICES
</h2>
344 <div class=
"sectionbody">
345 <div class=
"para"><p>These services can be enabled/disabled using the per-repository
346 configuration file:
</p></div>
347 <div class=
"vlist"><dl>
353 This serves Git clients older than version
1.6.6 that are unable to use the
354 upload pack service. When enabled, clients are able to read
355 any file within the repository, including objects that are
356 no longer reachable from a branch but are still present.
357 It is enabled by default, but a repository can disable it
358 by setting this configuration item to
<tt>false
</tt>.
366 This serves
<em>git fetch-pack
</em> and
<em>git ls-remote
</em> clients.
367 It is enabled by default, but a repository can disable it
368 by setting this configuration item to
<tt>false
</tt>.
376 This serves
<em>git send-pack
</em> clients, allowing push. It is
377 disabled by default for anonymous users, and enabled by
378 default for users authenticated by the web server. It can be
379 disabled by setting this item to
<tt>false
</tt>, or enabled for all
380 users, including anonymous users, by setting it to
<tt>true
</tt>.
385 <h2 id=
"_url_translation">URL TRANSLATION
</h2>
386 <div class=
"sectionbody">
387 <div class=
"para"><p>To determine the location of the repository on disk,
<em>git http-backend
</em>
388 concatenates the environment variables PATH_INFO, which is set
389 automatically by the web server, and GIT_PROJECT_ROOT, which must be set
390 manually in the web server configuration. If GIT_PROJECT_ROOT is not
391 set,
<em>git http-backend
</em> reads PATH_TRANSLATED, which is also set
392 automatically by the web server.
</p></div>
394 <h2 id=
"_examples">EXAMPLES
</h2>
395 <div class=
"sectionbody">
396 <div class=
"para"><p>All of the following examples map
<em>http://$hostname/git/foo/bar.git
</em>
397 to
<em>/var/www/git/foo/bar.git
</em>.
</p></div>
398 <div class=
"vlist"><dl>
404 Ensure mod_cgi, mod_alias, and mod_env are enabled, set
405 GIT_PROJECT_ROOT (or DocumentRoot) appropriately, and
406 create a ScriptAlias to the CGI:
408 <div class=
"listingblock">
409 <div class=
"content">
410 <pre><tt>SetEnv GIT_PROJECT_ROOT /var/www/git
411 SetEnv GIT_HTTP_EXPORT_ALL
412 ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
</tt></pre>
414 <div class=
"para"><p>To enable anonymous read access but authenticated write access,
415 require authorization with a LocationMatch directive:
</p></div>
416 <div class=
"listingblock">
417 <div class=
"content">
418 <pre><tt><LocationMatch
"^/git/.*/git-receive-pack$">
420 AuthName
"Git Access"
421 Require group committers
423 </LocationMatch
></tt></pre>
425 <div class=
"para"><p>To require authentication for both reads and writes, use a Location
426 directive around the repository, or one of its parent directories:
</p></div>
427 <div class=
"listingblock">
428 <div class=
"content">
429 <pre><tt><Location /git/private
>
431 AuthName
"Private Git Access"
432 Require group committers
434 </Location
></tt></pre>
436 <div class=
"para"><p>To serve gitweb at the same url, use a ScriptAliasMatch to only
437 those URLs that
<em>git http-backend
</em> can handle, and forward the
438 rest to gitweb:
</p></div>
439 <div class=
"listingblock">
440 <div class=
"content">
441 <pre><tt>ScriptAliasMatch \
442 "(?x)^/git/(.*/(HEAD | \
444 objects/(info/[^/]+ | \
445 [0-9a-f]{2}/[0-9a-f]{38} | \
446 pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
447 git-(upload|receive)-pack))$" \
448 /usr/libexec/git-core/git-http-backend/$
1
450 ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
</tt></pre>
454 Accelerated static Apache
2.x
458 Similar to the above, but Apache can be used to return static
459 files that are stored on disk. On many systems this may
460 be more efficient as Apache can ask the kernel to copy the
461 file contents from the file system directly to the network:
463 <div class=
"listingblock">
464 <div class=
"content">
465 <pre><tt>SetEnv GIT_PROJECT_ROOT /var/www/git
467 AliasMatch ^/git/(.*/objects/[
0-
9a-f]{
2}/[
0-
9a-f]{
38})$ /var/www/git/$
1
468 AliasMatch ^/git/(.*/objects/pack/pack-[
0-
9a-f]{
40}.(pack|idx))$ /var/www/git/$
1
469 ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
</tt></pre>
471 <div class=
"para"><p>This can be combined with the gitweb configuration:
</p></div>
472 <div class=
"listingblock">
473 <div class=
"content">
474 <pre><tt>SetEnv GIT_PROJECT_ROOT /var/www/git
476 AliasMatch ^/git/(.*/objects/[
0-
9a-f]{
2}/[
0-
9a-f]{
38})$ /var/www/git/$
1
477 AliasMatch ^/git/(.*/objects/pack/pack-[
0-
9a-f]{
40}.(pack|idx))$ /var/www/git/$
1
479 "(?x)^/git/(.*/(HEAD | \
481 objects/info/[^/]+ | \
482 git-(upload|receive)-pack))$" \
483 /usr/libexec/git-core/git-http-backend/$
1
484 ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
</tt></pre>
489 <h2 id=
"_environment">ENVIRONMENT
</h2>
490 <div class=
"sectionbody">
491 <div class=
"para"><p><em>git http-backend
</em> relies upon the CGI environment variables set
492 by the invoking web server, including:
</p></div>
493 <div class=
"ilist"><ul>
496 PATH_INFO (if GIT_PROJECT_ROOT is set, otherwise PATH_TRANSLATED)
525 <div class=
"para"><p>The GIT_HTTP_EXPORT_ALL environmental variable may be passed to
526 <em>git-http-backend
</em> to bypass the check for the
"git-daemon-export-ok"
527 file in each repository before allowing export of that repository.
</p></div>
528 <div class=
"para"><p>The backend process sets GIT_COMMITTER_NAME to
<em>$REMOTE_USER
</em> and
529 GIT_COMMITTER_EMAIL to
<em>${REMOTE_USER}@http.${REMOTE_ADDR}
</em>,
530 ensuring that any reflogs created by
<em>git-receive-pack
</em> contain some
531 identifying information of the remote user who performed the push.
</p></div>
532 <div class=
"para"><p>All CGI environment variables are available to each of the hooks
533 invoked by the
<em>git-receive-pack
</em>.
</p></div>
535 <h2 id=
"_author">Author
</h2>
536 <div class=
"sectionbody">
537 <div class=
"para"><p>Written by Shawn O. Pearce
<spearce@spearce.org
>.
</p></div>
539 <h2 id=
"_documentation">Documentation
</h2>
540 <div class=
"sectionbody">
541 <div class=
"para"><p>Documentation by Shawn O. Pearce
<spearce@spearce.org
>.
</p></div>
543 <h2 id=
"_git">GIT
</h2>
544 <div class=
"sectionbody">
545 <div class=
"para"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
548 <div id=
"footer-text">
549 Last updated
2010-
09-
03 21:
30:
20 UTC