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-daemon(
1)
</title>
312 git-daemon(
1) Manual Page
315 <div class=
"sectionbody">
317 A really simple server for git repositories
322 <div class=
"sectionbody">
323 <div class=
"verseblock">
324 <div class=
"content"><em>git daemon
</em> [--verbose] [--syslog] [--export-all]
325 [--timeout=n] [--init-timeout=n] [--max-connections=n]
326 [--strict-paths] [--base-path=path] [--base-path-relaxed]
327 [--user-path | --user-path=path]
328 [--interpolated-path=pathtemplate]
329 [--reuseaddr] [--detach] [--pid-file=file]
330 [--enable=service] [--disable=service]
331 [--allow-override=service] [--forbid-override=service]
332 [--inetd | [--listen=host_or_ipaddr] [--port=n] [--user=user [--group=group]]
333 [directory
…]
</div></div>
335 <h2 id=
"_description">DESCRIPTION
</h2>
336 <div class=
"sectionbody">
337 <div class=
"para"><p>A really simple TCP git daemon that normally listens on port
"DEFAULT_GIT_PORT"
338 aka
9418. It waits for a connection asking for a service, and will serve
339 that 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
341 it will refuse to export any git directory that hasn't explicitly been marked
342 for export this way (unless the
<em>--export-all
</em> parameter is specified). If you
343 pass some directory paths as
<em>git daemon
</em> arguments, you can further restrict
344 the 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
347 from
<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
349 git repositories.
</p></div>
350 <div class=
"para"><p>An
<tt>upload-archive
</tt> also exists to serve
<em>git archive
</em>.
</p></div>
352 <h2 id=
"_options">OPTIONS
</h2>
353 <div class=
"sectionbody">
354 <div class=
"vlist"><dl>
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.
362 <em>git daemon
</em> will refuse to start when this option is enabled and no
363 whitelist is specified.
371 Remap all the path requests as relative to the given path.
372 This is sort of
"GIT root" - if you run
<em>git daemon
</em> with
373 <em>--base-path=/srv/git
</em> on example.com, then if you later try to pull
374 <em>git://example.com/hello.git
</em>,
<em>git daemon
</em> will interpret the path
375 as
<em>/srv/git/hello.git
</em>.
383 If --base-path is enabled and repo lookup fails, with this option
384 <em>git daemon
</em> will attempt to lookup without prefixing the base path.
385 This is useful for switching to --base-path usage, while still
386 allowing the old paths.
390 --interpolated-path=pathtemplate
394 To support virtual hosting, an interpolated path template can be
395 used to dynamically construct alternate paths. The template
396 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,
399 and %D for the absolute path of the named repository.
400 After interpolation, the path is validated against the directory
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.
419 Have the server run as an inetd service. Implies --syslog.
420 Incompatible with --port, --listen, --user and --group options.
424 --listen=host_or_ipaddr
428 Listen on 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.
440 Listen on an alternative port. Incompatible with
<em>--inetd
</em> option.
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).
458 Timeout for specific client sub-requests. This includes the time
459 it takes for the server to process the sub-request and the time spent
460 waiting for the next client's request.
468 Maximum number of concurrent clients, defaults to
32. Set it to
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.
489 Allow
~user notation to be used in requests. When
490 specified with no parameter, requests to
491 git://host/
~alice/foo is taken as a request to access
492 <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>.
503 Log details about the incoming connections and requested files.
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.
521 Detach from the shell. Implies --syslog.
529 Save the process id in
<em>file
</em>. Ignored when the daemon
530 is run under
<tt>--inetd
</tt>.
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.
547 <div class=
"para"><p>Giving these options is an error when used with
<tt>--inetd
</tt>; use
548 the facility of inet daemon to achieve the same before spawning
549 <em>git daemon
</em> if needed.
</p></div>
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 a configuration
567 --allow-override=service
570 --forbid-override=service
574 Allow/forbid overriding the site-wide default with per
575 repository configuration. By default, all the services
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.
591 <h2 id=
"_services">SERVICES
</h2>
592 <div class=
"sectionbody">
593 <div class=
"para"><p>These services can be globally enabled/disabled using the
594 command line options of this command. If a finer-grained
595 control is desired (e.g. to allow
<em>git archive
</em> to be run
596 against only in a few selected repositories the daemon serves),
597 the per-repository configuration file can be used to enable or
598 disable them.
</p></div>
599 <div class=
"vlist"><dl>
605 This serves
<em>git fetch-pack
</em> and
<em>git ls-remote
</em>
606 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>.
616 This serves
<em>git archive --remote
</em>. It is disabled by
617 default, but a repository can enable it by setting
618 <tt>daemon.uploadarch
</tt> configuration item to
<tt>true
</tt>.
626 This serves
<em>git send-pack
</em> clients, allowing anonymous
627 push. It is disabled by default, as there is _no_
628 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
638 <h2 id=
"_examples">EXAMPLES
</h2>
639 <div class=
"sectionbody">
640 <div class=
"vlist"><dl>
642 We assume the following in /etc/services
645 <div class=
"listingblock">
646 <div class=
"content">
647 <pre><tt>$ grep
9418 /etc/services
648 git
9418/tcp # Git Version Control System
</tt></pre>
652 <em>git daemon
</em> as inetd server
656 To set up
<em>git daemon
</em> as an inetd service that handles any
657 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:
661 <div class=
"listingblock">
662 <div class=
"content">
663 <pre><tt> git stream tcp nowait nobody /usr/bin/git
664 git daemon --inetd --verbose --export-all
665 /pub/foo /pub/bar
</tt></pre>
669 <em>git daemon
</em> as inetd server for virtual hosts
673 To set up
<em>git daemon
</em> as an inetd service that handles
674 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:
678 <div class=
"listingblock">
679 <div class=
"content">
680 <pre><tt> git stream tcp nowait nobody /usr/bin/git
681 git daemon --inetd --verbose --export-all
682 --interpolated-path=/pub/%H%D
683 /pub/www.example.org/software
684 /pub/www.example.com/software
687 <div class=
"para"><p>In this example, the root-level directory
<tt>/pub
</tt> will contain
688 a subdirectory for each virtual host name supported.
689 Further, both hosts advertise repositories simply as
690 <tt>git://www.example.com/software/repo.git
</tt>. For pre-
1.4.0
691 clients, a symlink from
<tt>/software
</tt> into the appropriate
692 default repository could be made as well.
</p></div>
695 <em>git daemon
</em> as regular daemon for virtual hosts
699 To set up
<em>git daemon
</em> as a regular, non-inetd service that
700 handles repositories for multiple virtual hosts based on
701 their IP addresses, start the daemon like this:
703 <div class=
"listingblock">
704 <div class=
"content">
705 <pre><tt> git daemon --verbose --export-all
706 --interpolated-path=/pub/%IP/%D
707 /pub/
192.168.1.200/software
708 /pub/
10.10.220.23/software
</tt></pre>
710 <div class=
"para"><p>In this example, the root-level directory
<tt>/pub
</tt> will contain
711 a subdirectory for each virtual host IP address supported.
712 Repositories can still be accessed by hostname though, assuming
713 they correspond to these IP addresses.
</p></div>
716 selectively enable/disable services per repository
720 To enable
<em>git archive --remote
</em> and disable
<em>git fetch
</em> against
721 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
725 <div class=
"listingblock">
726 <div class=
"content">
729 uploadarch = true
</tt></pre>
734 <h2 id=
"_environment">ENVIRONMENT
</h2>
735 <div class=
"sectionbody">
736 <div class=
"para"><p><em>git daemon
</em> will set REMOTE_ADDR to the IP address of the client
737 that connected to it, if the IP address is available. REMOTE_ADDR will
738 be available in the environment of hooks called when
739 services are performed.
</p></div>
741 <h2 id=
"_author">Author
</h2>
742 <div class=
"sectionbody">
743 <div class=
"para"><p>Written by Linus Torvalds
<torvalds@osdl.org
>, YOSHIFUJI Hideaki
744 <yoshfuji@linux-ipv6.org
> and the git-list
<git@vger.kernel.org
></p></div>
746 <h2 id=
"_documentation">Documentation
</h2>
747 <div class=
"sectionbody">
748 <div class=
"para"><p>Documentation by Junio C Hamano and the git-list
<git@vger.kernel.org
>.
</p></div>
750 <h2 id=
"_git">GIT
</h2>
751 <div class=
"sectionbody">
752 <div class=
"para"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
755 <div id=
"footer-text">
756 Last updated
2010-
04-
24 02:
55:
52 UTC