blob: 601059fd1920bd562cfe3dd0c82c6f0b54f9fded [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!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">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-daemon(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-daemon(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-daemon -
Junio C Hamano01078922006-03-10 00:31:47317 A really simple server for git repositories
Junio C Hamano1a4e8412005-12-27 08:17:23318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
Junio C Hamanofce7c7e2008-07-02 03:06:38324<div class="content"><em>git daemon</em> [--verbose] [--syslog] [--export-all]
Junio C Hamanofcb740a2008-08-31 06:32:05325 [--timeout=n] [--init-timeout=n] [--max-connections=n]
326 [--strict-paths] [--base-path=path] [--base-path-relaxed]
327 [--user-path | --user-path=path]
Junio C Hamano47c1e3c2006-09-25 04:45:55328 [--interpolated-path=pathtemplate]
Junio C Hamano032c6312006-09-28 07:39:18329 [--reuseaddr] [--detach] [--pid-file=file]
Junio C Hamano19ed3682006-09-07 11:44:08330 [--enable=service] [--disable=service]
331 [--allow-override=service] [--forbid-override=service]
Junio C Hamano032c6312006-09-28 07:39:18332 [--inetd | [--listen=host_or_ipaddr] [--port=n] [--user=user [--group=group]]
333 [directory&#8230;]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23334</div>
Junio C Hamanoba4b9282008-07-06 05:20:31335<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23336<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31337<div class="para"><p>A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT"
Junio C Hamano19ed3682006-09-07 11:44:08338aka 9418. It waits for a connection asking for a service, and will serve
Junio C Hamanoba4b9282008-07-06 05:20:31339that service if it is enabled.</p></div>
340<div class="para"><p>It verifies that the directory has the magic file "git-daemon-export-ok", and
Junio C Hamano1a4e8412005-12-27 08:17:23341it will refuse to export any git directory that hasn't explicitly been marked
342for export this way (unless the <em>--export-all</em> parameter is specified). If you
Junio C Hamanoba4b9282008-07-06 05:20:31343pass some directory paths as <em>git-daemon</em> arguments, you can further restrict
344the offers to a whitelist comprising of those.</p></div>
345<div class="para"><p>By default, only <tt>upload-pack</tt> service is enabled, which serves
346<em>git-fetch-pack</em> and <em>git-ls-remote</em> clients, which are invoked
347from <em>git-fetch</em>, <em>git-pull</em>, and <em>git-clone</em>.</p></div>
348<div class="para"><p>This is ideally suited for read-only updates, i.e., pulling from
349git repositories.</p></div>
350<div class="para"><p>An <tt>upload-archive</tt> also exists to serve <em>git-archive</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23351</div>
Junio C Hamanoba4b9282008-07-06 05:20:31352<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23353<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31354<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23355<dt>
356--strict-paths
357</dt>
358<dd>
359<p>
360 Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
361 "/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
Junio C Hamanoba4b9282008-07-06 05:20:31362 <em>git-daemon</em> will refuse to start when this option is enabled and no
Junio C Hamano1a4e8412005-12-27 08:17:23363 whitelist is specified.
364</p>
365</dd>
366<dt>
Junio C Hamano4d04a402006-01-09 00:53:28367--base-path
368</dt>
369<dd>
370<p>
371 Remap all the path requests as relative to the given path.
Junio C Hamanoba4b9282008-07-06 05:20:31372 This is sort of "GIT root" - if you run <em>git-daemon</em> with
Junio C Hamano4d04a402006-01-09 00:53:28373 <em>--base-path=/srv/git</em> on example.com, then if you later try to pull
Junio C Hamanoba4b9282008-07-06 05:20:31374 <em>git://example.com/hello.git</em>, <em>git-daemon</em> will interpret the path
Junio C Hamano70fafca2006-02-06 08:02:01375 as <em>/srv/git/hello.git</em>.
Junio C Hamano4d04a402006-01-09 00:53:28376</p>
377</dd>
378<dt>
Junio C Hamano0ddc94d2007-08-01 08:42:39379--base-path-relaxed
380</dt>
381<dd>
382<p>
383 If --base-path is enabled and repo lookup fails, with this option
Junio C Hamanoba4b9282008-07-06 05:20:31384 <em>git-daemon</em> will attempt to lookup without prefixing the base path.
Junio C Hamano0ddc94d2007-08-01 08:42:39385 This is useful for switching to --base-path usage, while still
386 allowing the old paths.
387</p>
388</dd>
389<dt>
Junio C Hamano47c1e3c2006-09-25 04:45:55390--interpolated-path=pathtemplate
391</dt>
392<dd>
393<p>
394 To support virtual hosting, an interpolated path template can be
395 used to dynamically construct alternate paths. The template
Junio C Hamano032c6312006-09-28 07:39:18396 supports %H for the target hostname as supplied by the client but
397 converted to all lowercase, %CH for the canonical hostname,
398 %IP for the server's IP address, %P for the port number,
Junio C Hamano47c1e3c2006-09-25 04:45:55399 and %D for the absolute path of the named repository.
Junio C Hamano032c6312006-09-28 07:39:18400 After interpolation, the path is validated against the directory
401 whitelist.
Junio C Hamano47c1e3c2006-09-25 04:45:55402</p>
403</dd>
404<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23405--export-all
406</dt>
407<dd>
408<p>
409 Allow pulling from all directories that look like GIT repositories
410 (have the <em>objects</em> and <em>refs</em> subdirectories), even if they
411 do not have the <em>git-daemon-export-ok</em> file.
412</p>
413</dd>
414<dt>
415--inetd
416</dt>
417<dd>
418<p>
419 Have the server run as an inetd service. Implies --syslog.
Junio C Hamano032c6312006-09-28 07:39:18420 Incompatible with --port, --listen, --user and --group options.
Junio C Hamano1a4e8412005-12-27 08:17:23421</p>
422</dd>
423<dt>
Junio C Hamano032c6312006-09-28 07:39:18424--listen=host_or_ipaddr
Junio C Hamano1a4e8412005-12-27 08:17:23425</dt>
426<dd>
427<p>
Junio C Hamano032c6312006-09-28 07:39:18428 Listen on an a specific IP address or hostname. IP addresses can
429 be either an IPv4 address or an IPV6 address if supported. If IPv6
430 is not supported, then --listen=hostname is also not supported and
431 --listen must be given an IPv4 address.
432 Incompatible with <em>--inetd</em> option.
433</p>
434</dd>
435<dt>
436--port=n
437</dt>
438<dd>
439<p>
440 Listen on an alternative port. Incompatible with <em>--inetd</em> option.
Junio C Hamano1a4e8412005-12-27 08:17:23441</p>
442</dd>
443<dt>
444--init-timeout
445</dt>
446<dd>
447<p>
448 Timeout between the moment the connection is established and the
449 client request is received (typically a rather low value, since
450 that should be basically immediate).
451</p>
452</dd>
453<dt>
454--timeout
455</dt>
456<dd>
457<p>
458 Timeout for specific client sub-requests. This includes the time
459 it takes for the server to process the sub-request and time spent
460 waiting for next client's request.
461</p>
462</dd>
463<dt>
Junio C Hamanofcb740a2008-08-31 06:32:05464--max-connections
465</dt>
466<dd>
467<p>
468 Maximum number of concurrent clients, defaults to 32. Set it to
469 zero for no limit.
470</p>
471</dd>
472<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23473--syslog
474</dt>
475<dd>
476<p>
477 Log to syslog instead of stderr. Note that this option does not imply
478 --verbose, thus by default only error conditions will be logged.
479</p>
480</dd>
481<dt>
Junio C Hamanoeb415992008-06-08 22:49:47482--user-path
483</dt>
484<dt>
485--user-path=path
Junio C Hamano70fafca2006-02-06 08:02:01486</dt>
487<dd>
488<p>
Junio C Hamano4604fe52008-09-19 06:37:10489 Allow ~user notation to be used in requests. When
Junio C Hamano70fafca2006-02-06 08:02:01490 specified with no parameter, requests to
Junio C Hamano4604fe52008-09-19 06:37:10491 git://host/~alice/foo is taken as a request to access
Junio C Hamano70fafca2006-02-06 08:02:01492 <em>foo</em> repository in the home directory of user <tt>alice</tt>.
493 If <tt>--user-path=path</tt> is specified, the same request is
494 taken as a request to access <tt>path/foo</tt> repository in
495 the home directory of user <tt>alice</tt>.
496</p>
497</dd>
498<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23499--verbose
500</dt>
501<dd>
502<p>
503 Log details about the incoming connections and requested files.
504</p>
505</dd>
506<dt>
Junio C Hamanoabb53dc2006-07-28 05:14:12507--reuseaddr
508</dt>
509<dd>
510<p>
511 Use SO_REUSEADDR when binding the listening socket.
512 This allows the server to restart without waiting for
513 old connections to time out.
514</p>
515</dd>
516<dt>
517--detach
518</dt>
519<dd>
520<p>
521 Detach from the shell. Implies --syslog.
522</p>
523</dd>
524<dt>
525--pid-file=file
526</dt>
527<dd>
528<p>
Junio C Hamano21e7f9c2007-08-31 07:56:26529 Save the process id in <em>file</em>. Ignored when the daemon
530 is run under <tt>--inetd</tt>.
Junio C Hamanoabb53dc2006-07-28 05:14:12531</p>
532</dd>
533<dt>
Junio C Hamanoeb415992008-06-08 22:49:47534--user=user
535</dt>
536<dt>
537--group=group
Junio C Hamano9adfc6a2006-08-28 07:18:38538</dt>
539<dd>
540<p>
541 Change daemon's uid and gid before entering the service loop.
542 When only <tt>--user</tt> is given without <tt>--group</tt>, the
543 primary group ID for the user is used. The values of
544 the option are given to <tt>getpwnam(3)</tt> and <tt>getgrnam(3)</tt>
545 and numeric IDs are not supported.
546</p>
Junio C Hamanoba4b9282008-07-06 05:20:31547<div class="para"><p>Giving these options is an error when used with <tt>--inetd</tt>; use
Junio C Hamano9adfc6a2006-08-28 07:18:38548the facility of inet daemon to achieve the same before spawning
Junio C Hamanoba4b9282008-07-06 05:20:31549<em>git-daemon</em> if needed.</p></div>
Junio C Hamano9adfc6a2006-08-28 07:18:38550</dd>
551<dt>
Junio C Hamanoeb415992008-06-08 22:49:47552--enable=service
553</dt>
554<dt>
555--disable=service
Junio C Hamano19ed3682006-09-07 11:44:08556</dt>
557<dd>
558<p>
559 Enable/disable the service site-wide per default. Note
560 that a service disabled site-wide can still be enabled
561 per repository if it is marked overridable and the
562 repository enables the service with an configuration
563 item.
564</p>
565</dd>
566<dt>
Junio C Hamanoeb415992008-06-08 22:49:47567--allow-override=service
568</dt>
569<dt>
570--forbid-override=service
Junio C Hamano19ed3682006-09-07 11:44:08571</dt>
572<dd>
573<p>
574 Allow/forbid overriding the site-wide default with per
575 repository configuration. By default, all the services
576 are overridable.
577</p>
578</dd>
579<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23580&lt;directory&gt;
581</dt>
582<dd>
583<p>
584 A directory to add to the whitelist of allowed directories. Unless
585 --strict-paths is specified this will also include subdirectories
586 of each named directory.
587</p>
588</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31589</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:23590</div>
Junio C Hamanoba4b9282008-07-06 05:20:31591<h2 id="_services">SERVICES</h2>
Junio C Hamano19ed3682006-09-07 11:44:08592<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31593<div class="para"><p>These services can be globally enabled/disabled using the
Junio C Hamano21e7f9c2007-08-31 07:56:26594command line options of this command. If a finer-grained
Junio C Hamanoba4b9282008-07-06 05:20:31595control is desired (e.g. to allow <em>git-archive</em> to be run
Junio C Hamano21e7f9c2007-08-31 07:56:26596against only in a few selected repositories the daemon serves),
597the per-repository configuration file can be used to enable or
Junio C Hamanoba4b9282008-07-06 05:20:31598disable them.</p></div>
599<div class="vlist"><dl>
Junio C Hamano19ed3682006-09-07 11:44:08600<dt>
601upload-pack
602</dt>
603<dd>
604<p>
Junio C Hamanoba4b9282008-07-06 05:20:31605 This serves <em>git-fetch-pack</em> and <em>git-ls-remote</em>
Junio C Hamano19ed3682006-09-07 11:44:08606 clients. It is enabled by default, but a repository can
607 disable it by setting <tt>daemon.uploadpack</tt> configuration
608 item to <tt>false</tt>.
609</p>
610</dd>
Junio C Hamanoa053d542006-10-27 09:29:13611<dt>
612upload-archive
613</dt>
614<dd>
615<p>
Junio C Hamanoba4b9282008-07-06 05:20:31616 This serves <em>git-archive --remote</em>. It is disabled by
Junio C Hamano21e7f9c2007-08-31 07:56:26617 default, but a repository can enable it by setting
Junio C Hamanofeeb1be2008-05-22 00:53:35618 <tt>daemon.uploadarch</tt> configuration item to <tt>true</tt>.
Junio C Hamano21e7f9c2007-08-31 07:56:26619</p>
620</dd>
621<dt>
622receive-pack
623</dt>
624<dd>
625<p>
Junio C Hamanoba4b9282008-07-06 05:20:31626 This serves <em>git-send-pack</em> clients, allowing anonymous
Junio C Hamano4604fe52008-09-19 06:37:10627 push. It is disabled by default, as there is _no_
Junio C Hamano21e7f9c2007-08-31 07:56:26628 authentication in the protocol (in other words, anybody
629 can push anything into the repository, including removal
630 of refs). This is solely meant for a closed LAN setting
631 where everybody is friendly. This service can be
632 enabled by <tt>daemon.receivepack</tt> configuration item to
633 <tt>true</tt>.
Junio C Hamanoa053d542006-10-27 09:29:13634</p>
635</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31636</dl></div>
Junio C Hamano19ed3682006-09-07 11:44:08637</div>
Junio C Hamanoba4b9282008-07-06 05:20:31638<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano47c1e3c2006-09-25 04:45:55639<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31640<div class="vlist"><dl>
Junio C Hamano47c1e3c2006-09-25 04:45:55641<dt>
Junio C Hamanoa053d542006-10-27 09:29:13642We assume the following in /etc/services
643</dt>
644<dd>
645<div class="listingblock">
646<div class="content">
647<pre><tt>$ grep 9418 /etc/services
648git 9418/tcp # Git Version Control System</tt></pre>
649</div></div>
650</dd>
651<dt>
Junio C Hamanoba4b9282008-07-06 05:20:31652<em>git-daemon</em> as inetd server
Junio C Hamano47c1e3c2006-09-25 04:45:55653</dt>
654<dd>
655<p>
Junio C Hamanoba4b9282008-07-06 05:20:31656 To set up <em>git-daemon</em> as an inetd service that handles any
Junio C Hamano47c1e3c2006-09-25 04:45:55657 repository under the whitelisted set of directories, /pub/foo
658 and /pub/bar, place an entry like the following into
659 /etc/inetd all on one line:
660</p>
661<div class="listingblock">
662<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:38663<pre><tt> git stream tcp nowait nobody /usr/bin/git
664 git daemon --inetd --verbose --export-all
Junio C Hamano47c1e3c2006-09-25 04:45:55665 /pub/foo /pub/bar</tt></pre>
666</div></div>
667</dd>
668<dt>
Junio C Hamanoba4b9282008-07-06 05:20:31669<em>git-daemon</em> as inetd server for virtual hosts
Junio C Hamano47c1e3c2006-09-25 04:45:55670</dt>
671<dd>
672<p>
Junio C Hamanoba4b9282008-07-06 05:20:31673 To set up <em>git-daemon</em> as an inetd service that handles
Junio C Hamano47c1e3c2006-09-25 04:45:55674 repositories for different virtual hosts, <tt>www.example.com</tt>
675 and <tt>www.example.org</tt>, place an entry like the following into
676 <tt>/etc/inetd</tt> all on one line:
677</p>
678<div class="listingblock">
679<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:38680<pre><tt> git stream tcp nowait nobody /usr/bin/git
681 git daemon --inetd --verbose --export-all
Junio C Hamano47c1e3c2006-09-25 04:45:55682 --interpolated-path=/pub/%H%D
683 /pub/www.example.org/software
684 /pub/www.example.com/software
685 /software</tt></pre>
686</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31687<div class="para"><p>In this example, the root-level directory <tt>/pub</tt> will contain
Junio C Hamano47c1e3c2006-09-25 04:45:55688a subdirectory for each virtual host name supported.
689Further, both hosts advertise repositories simply as
690<tt>git://www.example.com/software/repo.git</tt>. For pre-1.4.0
691clients, a symlink from <tt>/software</tt> into the appropriate
Junio C Hamanoba4b9282008-07-06 05:20:31692default repository could be made as well.</p></div>
Junio C Hamano47c1e3c2006-09-25 04:45:55693</dd>
Junio C Hamano032c6312006-09-28 07:39:18694<dt>
Junio C Hamanoba4b9282008-07-06 05:20:31695<em>git-daemon</em> as regular daemon for virtual hosts
Junio C Hamano032c6312006-09-28 07:39:18696</dt>
697<dd>
698<p>
Junio C Hamanoba4b9282008-07-06 05:20:31699 To set up <em>git-daemon</em> as a regular, non-inetd service that
Junio C Hamano032c6312006-09-28 07:39:18700 handles repositories for multiple virtual hosts based on
701 their IP addresses, start the daemon like this:
702</p>
703<div class="listingblock">
704<div class="content">
Junio C Hamanofce7c7e2008-07-02 03:06:38705<pre><tt> git daemon --verbose --export-all
Junio C Hamano032c6312006-09-28 07:39:18706 --interpolated-path=/pub/%IP/%D
707 /pub/192.168.1.200/software
708 /pub/10.10.220.23/software</tt></pre>
709</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31710<div class="para"><p>In this example, the root-level directory <tt>/pub</tt> will contain
Junio C Hamano032c6312006-09-28 07:39:18711a subdirectory for each virtual host IP address supported.
712Repositories can still be accessed by hostname though, assuming
Junio C Hamanoba4b9282008-07-06 05:20:31713they correspond to these IP addresses.</p></div>
Junio C Hamano032c6312006-09-28 07:39:18714</dd>
Junio C Hamanodbb64592007-09-01 11:17:39715<dt>
716selectively enable/disable services per repository
717</dt>
718<dd>
719<p>
Junio C Hamanoba4b9282008-07-06 05:20:31720 To enable <em>git-archive --remote</em> and disable <em>git-fetch</em> against
Junio C Hamanodbb64592007-09-01 11:17:39721 a repository, have the following in the configuration file in the
722 repository (that is the file <em>config</em> next to <em>HEAD</em>, <em>refs</em> and
723 <em>objects</em>).
724</p>
Junio C Hamano21e7f9c2007-08-31 07:56:26725<div class="listingblock">
726<div class="content">
Junio C Hamanodbb64592007-09-01 11:17:39727<pre><tt> [daemon]
728 uploadpack = false
Junio C Hamanofeeb1be2008-05-22 00:53:35729 uploadarch = true</tt></pre>
Junio C Hamano21e7f9c2007-08-31 07:56:26730</div></div>
Junio C Hamanodbb64592007-09-01 11:17:39731</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31732</dl></div>
Junio C Hamano47c1e3c2006-09-25 04:45:55733</div>
Junio C Hamanoba4b9282008-07-06 05:20:31734<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23735<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31736<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;, YOSHIFUJI Hideaki
737&lt;yoshfuji@linux-ipv6.org&gt; and the git-list &lt;git@vger.kernel.org&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23738</div>
Junio C Hamanoba4b9282008-07-06 05:20:31739<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23740<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31741<div class="para"><p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23742</div>
Junio C Hamanoba4b9282008-07-06 05:20:31743<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23744<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31745<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23746</div>
747<div id="footer">
748<div id="footer-text">
Junio C Hamano4604fe52008-09-19 06:37:10749Last updated 2008-09-19 06:32:49 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23750</div>
751</div>
752</body>
753</html>