Autogenerated HTML docs for v1.7.7-419-g87009
[git/jnareb-git.git] / git-daemon.html
blob2ae67b9c69eeaca375be00088d60d67489ae3e22
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">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-daemon(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-daemon(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-daemon -
578 A really simple server for git repositories
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git daemon</em> [--verbose] [--syslog] [--export-all]
587 [--timeout=&lt;n&gt;] [--init-timeout=&lt;n&gt;] [--max-connections=&lt;n&gt;]
588 [--strict-paths] [--base-path=&lt;path&gt;] [--base-path-relaxed]
589 [--user-path | --user-path=&lt;path&gt;]
590 [--interpolated-path=&lt;pathtemplate&gt;]
591 [--reuseaddr] [--detach] [--pid-file=&lt;file&gt;]
592 [--enable=&lt;service&gt;] [--disable=&lt;service&gt;]
593 [--allow-override=&lt;service&gt;] [--forbid-override=&lt;service&gt;]
594 [--inetd | [--listen=&lt;host_or_ipaddr&gt;] [--port=&lt;n&gt;] [--user=&lt;user&gt; [--group=&lt;group&gt;]]
595 [&lt;directory&gt;&#8230;]</div>
596 <div class="verseblock-attribution">
597 </div></div>
598 </div>
599 <h2 id="_description">DESCRIPTION</h2>
600 <div class="sectionbody">
601 <div class="paragraph"><p>A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT"
602 aka 9418. It waits for a connection asking for a service, and will serve
603 that service if it is enabled.</p></div>
604 <div class="paragraph"><p>It verifies that the directory has the magic file "git-daemon-export-ok", and
605 it will refuse to export any git directory that hasn&#8217;t explicitly been marked
606 for export this way (unless the <em>--export-all</em> parameter is specified). If you
607 pass some directory paths as <em>git daemon</em> arguments, you can further restrict
608 the offers to a whitelist comprising of those.</p></div>
609 <div class="paragraph"><p>By default, only <tt>upload-pack</tt> service is enabled, which serves
610 <em>git fetch-pack</em> and <em>git ls-remote</em> clients, which are invoked
611 from <em>git fetch</em>, <em>git pull</em>, and <em>git clone</em>.</p></div>
612 <div class="paragraph"><p>This is ideally suited for read-only updates, i.e., pulling from
613 git repositories.</p></div>
614 <div class="paragraph"><p>An <tt>upload-archive</tt> also exists to serve <em>git archive</em>.</p></div>
615 </div>
616 <h2 id="_options">OPTIONS</h2>
617 <div class="sectionbody">
618 <div class="dlist"><dl>
619 <dt class="hdlist1">
620 --strict-paths
621 </dt>
622 <dd>
624 Match paths exactly (i.e. don&#8217;t allow "/foo/repo" when the real path is
625 "/foo/repo.git" or "/foo/repo/.git") and don&#8217;t do user-relative paths.
626 <em>git daemon</em> will refuse to start when this option is enabled and no
627 whitelist is specified.
628 </p>
629 </dd>
630 <dt class="hdlist1">
631 --base-path=&lt;path&gt;
632 </dt>
633 <dd>
635 Remap all the path requests as relative to the given path.
636 This is sort of "GIT root" - if you run <em>git daemon</em> with
637 <em>--base-path=/srv/git</em> on example.com, then if you later try to pull
638 <em>git://example.com/hello.git</em>, <em>git daemon</em> will interpret the path
639 as <em>/srv/git/hello.git</em>.
640 </p>
641 </dd>
642 <dt class="hdlist1">
643 --base-path-relaxed
644 </dt>
645 <dd>
647 If --base-path is enabled and repo lookup fails, with this option
648 <em>git daemon</em> will attempt to lookup without prefixing the base path.
649 This is useful for switching to --base-path usage, while still
650 allowing the old paths.
651 </p>
652 </dd>
653 <dt class="hdlist1">
654 --interpolated-path=&lt;pathtemplate&gt;
655 </dt>
656 <dd>
658 To support virtual hosting, an interpolated path template can be
659 used to dynamically construct alternate paths. The template
660 supports %H for the target hostname as supplied by the client but
661 converted to all lowercase, %CH for the canonical hostname,
662 %IP for the server&#8217;s IP address, %P for the port number,
663 and %D for the absolute path of the named repository.
664 After interpolation, the path is validated against the directory
665 whitelist.
666 </p>
667 </dd>
668 <dt class="hdlist1">
669 --export-all
670 </dt>
671 <dd>
673 Allow pulling from all directories that look like GIT repositories
674 (have the <em>objects</em> and <em>refs</em> subdirectories), even if they
675 do not have the <em>git-daemon-export-ok</em> file.
676 </p>
677 </dd>
678 <dt class="hdlist1">
679 --inetd
680 </dt>
681 <dd>
683 Have the server run as an inetd service. Implies --syslog.
684 Incompatible with --detach, --port, --listen, --user and --group
685 options.
686 </p>
687 </dd>
688 <dt class="hdlist1">
689 --listen=&lt;host_or_ipaddr&gt;
690 </dt>
691 <dd>
693 Listen on a specific IP address or hostname. IP addresses can
694 be either an IPv4 address or an IPv6 address if supported. If IPv6
695 is not supported, then --listen=hostname is also not supported and
696 --listen must be given an IPv4 address.
697 Can be given more than once.
698 Incompatible with <em>--inetd</em> option.
699 </p>
700 </dd>
701 <dt class="hdlist1">
702 --port=&lt;n&gt;
703 </dt>
704 <dd>
706 Listen on an alternative port. Incompatible with <em>--inetd</em> option.
707 </p>
708 </dd>
709 <dt class="hdlist1">
710 --init-timeout=&lt;n&gt;
711 </dt>
712 <dd>
714 Timeout (in seconds) between the moment the connection is established
715 and the client request is received (typically a rather low value, since
716 that should be basically immediate).
717 </p>
718 </dd>
719 <dt class="hdlist1">
720 --timeout=&lt;n&gt;
721 </dt>
722 <dd>
724 Timeout (in seconds) for specific client sub-requests. This includes
725 the time it takes for the server to process the sub-request and the
726 time spent waiting for the next client&#8217;s request.
727 </p>
728 </dd>
729 <dt class="hdlist1">
730 --max-connections=&lt;n&gt;
731 </dt>
732 <dd>
734 Maximum number of concurrent clients, defaults to 32. Set it to
735 zero for no limit.
736 </p>
737 </dd>
738 <dt class="hdlist1">
739 --syslog
740 </dt>
741 <dd>
743 Log to syslog instead of stderr. Note that this option does not imply
744 --verbose, thus by default only error conditions will be logged.
745 </p>
746 </dd>
747 <dt class="hdlist1">
748 --user-path
749 </dt>
750 <dt class="hdlist1">
751 --user-path=&lt;path&gt;
752 </dt>
753 <dd>
755 Allow &#126;user notation to be used in requests. When
756 specified with no parameter, requests to
757 git://host/&#126;alice/foo is taken as a request to access
758 <em>foo</em> repository in the home directory of user <tt>alice</tt>.
759 If <tt>--user-path=path</tt> is specified, the same request is
760 taken as a request to access <tt>path/foo</tt> repository in
761 the home directory of user <tt>alice</tt>.
762 </p>
763 </dd>
764 <dt class="hdlist1">
765 --verbose
766 </dt>
767 <dd>
769 Log details about the incoming connections and requested files.
770 </p>
771 </dd>
772 <dt class="hdlist1">
773 --reuseaddr
774 </dt>
775 <dd>
777 Use SO_REUSEADDR when binding the listening socket.
778 This allows the server to restart without waiting for
779 old connections to time out.
780 </p>
781 </dd>
782 <dt class="hdlist1">
783 --detach
784 </dt>
785 <dd>
787 Detach from the shell. Implies --syslog.
788 </p>
789 </dd>
790 <dt class="hdlist1">
791 --pid-file=&lt;file&gt;
792 </dt>
793 <dd>
795 Save the process id in <em>file</em>. Ignored when the daemon
796 is run under <tt>--inetd</tt>.
797 </p>
798 </dd>
799 <dt class="hdlist1">
800 --user=&lt;user&gt;
801 </dt>
802 <dt class="hdlist1">
803 --group=&lt;group&gt;
804 </dt>
805 <dd>
807 Change daemon&#8217;s uid and gid before entering the service loop.
808 When only <tt>--user</tt> is given without <tt>--group</tt>, the
809 primary group ID for the user is used. The values of
810 the option are given to <tt>getpwnam(3)</tt> and <tt>getgrnam(3)</tt>
811 and numeric IDs are not supported.
812 </p>
813 <div class="paragraph"><p>Giving these options is an error when used with <tt>--inetd</tt>; use
814 the facility of inet daemon to achieve the same before spawning
815 <em>git daemon</em> if needed.</p></div>
816 </dd>
817 <dt class="hdlist1">
818 --enable=&lt;service&gt;
819 </dt>
820 <dt class="hdlist1">
821 --disable=&lt;service&gt;
822 </dt>
823 <dd>
825 Enable/disable the service site-wide per default. Note
826 that a service disabled site-wide can still be enabled
827 per repository if it is marked overridable and the
828 repository enables the service with a configuration
829 item.
830 </p>
831 </dd>
832 <dt class="hdlist1">
833 --allow-override=&lt;service&gt;
834 </dt>
835 <dt class="hdlist1">
836 --forbid-override=&lt;service&gt;
837 </dt>
838 <dd>
840 Allow/forbid overriding the site-wide default with per
841 repository configuration. By default, all the services
842 are overridable.
843 </p>
844 </dd>
845 <dt class="hdlist1">
846 &lt;directory&gt;
847 </dt>
848 <dd>
850 A directory to add to the whitelist of allowed directories. Unless
851 --strict-paths is specified this will also include subdirectories
852 of each named directory.
853 </p>
854 </dd>
855 </dl></div>
856 </div>
857 <h2 id="_services">SERVICES</h2>
858 <div class="sectionbody">
859 <div class="paragraph"><p>These services can be globally enabled/disabled using the
860 command line options of this command. If a finer-grained
861 control is desired (e.g. to allow <em>git archive</em> to be run
862 against only in a few selected repositories the daemon serves),
863 the per-repository configuration file can be used to enable or
864 disable them.</p></div>
865 <div class="dlist"><dl>
866 <dt class="hdlist1">
867 upload-pack
868 </dt>
869 <dd>
871 This serves <em>git fetch-pack</em> and <em>git ls-remote</em>
872 clients. It is enabled by default, but a repository can
873 disable it by setting <tt>daemon.uploadpack</tt> configuration
874 item to <tt>false</tt>.
875 </p>
876 </dd>
877 <dt class="hdlist1">
878 upload-archive
879 </dt>
880 <dd>
882 This serves <em>git archive --remote</em>. It is disabled by
883 default, but a repository can enable it by setting
884 <tt>daemon.uploadarch</tt> configuration item to <tt>true</tt>.
885 </p>
886 </dd>
887 <dt class="hdlist1">
888 receive-pack
889 </dt>
890 <dd>
892 This serves <em>git send-pack</em> clients, allowing anonymous
893 push. It is disabled by default, as there is <em>no</em>
894 authentication in the protocol (in other words, anybody
895 can push anything into the repository, including removal
896 of refs). This is solely meant for a closed LAN setting
897 where everybody is friendly. This service can be
898 enabled by <tt>daemon.receivepack</tt> configuration item to
899 <tt>true</tt>.
900 </p>
901 </dd>
902 </dl></div>
903 </div>
904 <h2 id="_examples">EXAMPLES</h2>
905 <div class="sectionbody">
906 <div class="dlist"><dl>
907 <dt class="hdlist1">
908 We assume the following in /etc/services
909 </dt>
910 <dd>
911 <div class="listingblock">
912 <div class="content">
913 <pre><tt>$ grep 9418 /etc/services
914 git 9418/tcp # Git Version Control System</tt></pre>
915 </div></div>
916 </dd>
917 <dt class="hdlist1">
918 <em>git daemon</em> as inetd server
919 </dt>
920 <dd>
922 To set up <em>git daemon</em> as an inetd service that handles any
923 repository under the whitelisted set of directories, /pub/foo
924 and /pub/bar, place an entry like the following into
925 /etc/inetd all on one line:
926 </p>
927 <div class="listingblock">
928 <div class="content">
929 <pre><tt> git stream tcp nowait nobody /usr/bin/git
930 git daemon --inetd --verbose --export-all
931 /pub/foo /pub/bar</tt></pre>
932 </div></div>
933 </dd>
934 <dt class="hdlist1">
935 <em>git daemon</em> as inetd server for virtual hosts
936 </dt>
937 <dd>
939 To set up <em>git daemon</em> as an inetd service that handles
940 repositories for different virtual hosts, <tt>www.example.com</tt>
941 and <tt>www.example.org</tt>, place an entry like the following into
942 <tt>/etc/inetd</tt> all on one line:
943 </p>
944 <div class="listingblock">
945 <div class="content">
946 <pre><tt> git stream tcp nowait nobody /usr/bin/git
947 git daemon --inetd --verbose --export-all
948 --interpolated-path=/pub/%H%D
949 /pub/www.example.org/software
950 /pub/www.example.com/software
951 /software</tt></pre>
952 </div></div>
953 <div class="paragraph"><p>In this example, the root-level directory <tt>/pub</tt> will contain
954 a subdirectory for each virtual host name supported.
955 Further, both hosts advertise repositories simply as
956 <tt>git://www.example.com/software/repo.git</tt>. For pre-1.4.0
957 clients, a symlink from <tt>/software</tt> into the appropriate
958 default repository could be made as well.</p></div>
959 </dd>
960 <dt class="hdlist1">
961 <em>git daemon</em> as regular daemon for virtual hosts
962 </dt>
963 <dd>
965 To set up <em>git daemon</em> as a regular, non-inetd service that
966 handles repositories for multiple virtual hosts based on
967 their IP addresses, start the daemon like this:
968 </p>
969 <div class="listingblock">
970 <div class="content">
971 <pre><tt> git daemon --verbose --export-all
972 --interpolated-path=/pub/%IP/%D
973 /pub/192.168.1.200/software
974 /pub/10.10.220.23/software</tt></pre>
975 </div></div>
976 <div class="paragraph"><p>In this example, the root-level directory <tt>/pub</tt> will contain
977 a subdirectory for each virtual host IP address supported.
978 Repositories can still be accessed by hostname though, assuming
979 they correspond to these IP addresses.</p></div>
980 </dd>
981 <dt class="hdlist1">
982 selectively enable/disable services per repository
983 </dt>
984 <dd>
986 To enable <em>git archive --remote</em> and disable <em>git fetch</em> against
987 a repository, have the following in the configuration file in the
988 repository (that is the file <em>config</em> next to <em>HEAD</em>, <em>refs</em> and
989 <em>objects</em>).
990 </p>
991 <div class="listingblock">
992 <div class="content">
993 <pre><tt> [daemon]
994 uploadpack = false
995 uploadarch = true</tt></pre>
996 </div></div>
997 </dd>
998 </dl></div>
999 </div>
1000 <h2 id="_environment">ENVIRONMENT</h2>
1001 <div class="sectionbody">
1002 <div class="paragraph"><p><em>git daemon</em> will set REMOTE_ADDR to the IP address of the client
1003 that connected to it, if the IP address is available. REMOTE_ADDR will
1004 be available in the environment of hooks called when
1005 services are performed.</p></div>
1006 </div>
1007 <h2 id="_git">GIT</h2>
1008 <div class="sectionbody">
1009 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1010 </div>
1011 </div>
1012 <div id="footnotes"><hr /></div>
1013 <div id="footer">
1014 <div id="footer-text">
1015 Last updated 2011-09-21 23:01:14 PDT
1016 </div>
1017 </div>
1018 </body>
1019 </html>