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.4.5" />
7 <title>git-daemon(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.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
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
245 list-style-type: upper-roman
;
248 div
.compact ul
, div
.compact ol
,
249 div
.compact p
, div
.compact p
,
250 div
.compact div
, div
.compact div
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
275 div
.tableblock
> table
[frame
="hsides"] {
276 border-left-style: none
;
277 border-right-style: none
;
279 div
.tableblock
> table
[frame
="vsides"] {
280 border-top-style: none
;
281 border-bottom-style: none
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-daemon(
1) Manual Page
409 <div class=
"sectionbody">
411 A really simple server for git repositories
415 <h2 id=
"_synopsis">SYNOPSIS
</h2>
416 <div class=
"sectionbody">
417 <div class=
"verseblock">
418 <div class=
"verseblock-content"><em>git daemon
</em> [--verbose] [--syslog] [--export-all]
419 [--timeout=
<n
>] [--init-timeout=
<n
>] [--max-connections=
<n
>]
420 [--strict-paths] [--base-path=
<path
>] [--base-path-relaxed]
421 [--user-path | --user-path=
<path
>]
422 [--interpolated-path=
<pathtemplate
>]
423 [--reuseaddr] [--detach] [--pid-file=
<file
>]
424 [--enable=
<service
>] [--disable=
<service
>]
425 [--allow-override=
<service
>] [--forbid-override=
<service
>]
426 [--inetd | [--listen=
<host_or_ipaddr
>] [--port=
<n
>] [--user=
<user
> [--group=
<group
>]]
427 [
<directory
>…]
</div>
428 <div class=
"verseblock-attribution">
431 <h2 id=
"_description">DESCRIPTION
</h2>
432 <div class=
"sectionbody">
433 <div class=
"paragraph"><p>A really simple TCP git daemon that normally listens on port
"DEFAULT_GIT_PORT"
434 aka
9418. It waits for a connection asking for a service, and will serve
435 that service if it is enabled.
</p></div>
436 <div class=
"paragraph"><p>It verifies that the directory has the magic file
"git-daemon-export-ok", and
437 it will refuse to export any git directory that hasn
’t explicitly been marked
438 for export this way (unless the
<em>--export-all
</em> parameter is specified). If you
439 pass some directory paths as
<em>git daemon
</em> arguments, you can further restrict
440 the offers to a whitelist comprising of those.
</p></div>
441 <div class=
"paragraph"><p>By default, only
<tt>upload-pack
</tt> service is enabled, which serves
442 <em>git fetch-pack
</em> and
<em>git ls-remote
</em> clients, which are invoked
443 from
<em>git fetch
</em>,
<em>git pull
</em>, and
<em>git clone
</em>.
</p></div>
444 <div class=
"paragraph"><p>This is ideally suited for read-only updates, i.e., pulling from
445 git repositories.
</p></div>
446 <div class=
"paragraph"><p>An
<tt>upload-archive
</tt> also exists to serve
<em>git archive
</em>.
</p></div>
448 <h2 id=
"_options">OPTIONS
</h2>
449 <div class=
"sectionbody">
450 <div class=
"dlist"><dl>
456 Match paths exactly (i.e. don
’t allow
"/foo/repo" when the real path is
457 "/foo/repo.git" or
"/foo/repo/.git") and don
’t do user-relative paths.
458 <em>git daemon
</em> will refuse to start when this option is enabled and no
459 whitelist is specified.
463 --base-path=
<path
>
467 Remap all the path requests as relative to the given path.
468 This is sort of
"GIT root" - if you run
<em>git daemon
</em> with
469 <em>--base-path=/srv/git
</em> on example.com, then if you later try to pull
470 <em>git://example.com/hello.git
</em>,
<em>git daemon
</em> will interpret the path
471 as
<em>/srv/git/hello.git
</em>.
479 If --base-path is enabled and repo lookup fails, with this option
480 <em>git daemon
</em> will attempt to lookup without prefixing the base path.
481 This is useful for switching to --base-path usage, while still
482 allowing the old paths.
486 --interpolated-path=
<pathtemplate
>
490 To support virtual hosting, an interpolated path template can be
491 used to dynamically construct alternate paths. The template
492 supports %H for the target hostname as supplied by the client but
493 converted to all lowercase, %CH for the canonical hostname,
494 %IP for the server
’s IP address, %P for the port number,
495 and %D for the absolute path of the named repository.
496 After interpolation, the path is validated against the directory
505 Allow pulling from all directories that look like GIT repositories
506 (have the
<em>objects
</em> and
<em>refs
</em> subdirectories), even if they
507 do not have the
<em>git-daemon-export-ok
</em> file.
515 Have the server run as an inetd service. Implies --syslog.
516 Incompatible with --detach, --port, --listen, --user and --group
521 --listen=
<host_or_ipaddr
>
525 Listen on a specific IP address or hostname. IP addresses can
526 be either an IPv4 address or an IPv6 address if supported. If IPv6
527 is not supported, then --listen=hostname is also not supported and
528 --listen must be given an IPv4 address.
529 Can be given more than once.
530 Incompatible with
<em>--inetd
</em> option.
538 Listen on an alternative port. Incompatible with
<em>--inetd
</em> option.
542 --init-timeout=
<n
>
546 Timeout between the moment the connection is established and the
547 client request is received (typically a rather low value, since
548 that should be basically immediate).
556 Timeout for specific client sub-requests. This includes the time
557 it takes for the server to process the sub-request and the time spent
558 waiting for the next client
’s request.
562 --max-connections=
<n
>
566 Maximum number of concurrent clients, defaults to
32. Set it to
575 Log to syslog instead of stderr. Note that this option does not imply
576 --verbose, thus by default only error conditions will be logged.
583 --user-path=
<path
>
587 Allow
~user notation to be used in requests. When
588 specified with no parameter, requests to
589 git://host/
~alice/foo is taken as a request to access
590 <em>foo
</em> repository in the home directory of user
<tt>alice
</tt>.
591 If
<tt>--user-path=path
</tt> is specified, the same request is
592 taken as a request to access
<tt>path/foo
</tt> repository in
593 the home directory of user
<tt>alice
</tt>.
601 Log details about the incoming connections and requested files.
609 Use SO_REUSEADDR when binding the listening socket.
610 This allows the server to restart without waiting for
611 old connections to time out.
619 Detach from the shell. Implies --syslog.
623 --pid-file=
<file
>
627 Save the process id in
<em>file
</em>. Ignored when the daemon
628 is run under
<tt>--inetd
</tt>.
635 --group=
<group
>
639 Change daemon
’s uid and gid before entering the service loop.
640 When only
<tt>--user
</tt> is given without
<tt>--group
</tt>, the
641 primary group ID for the user is used. The values of
642 the option are given to
<tt>getpwnam(
3)
</tt> and
<tt>getgrnam(
3)
</tt>
643 and numeric IDs are not supported.
645 <div class=
"paragraph"><p>Giving these options is an error when used with
<tt>--inetd
</tt>; use
646 the facility of inet daemon to achieve the same before spawning
647 <em>git daemon
</em> if needed.
</p></div>
650 --enable=
<service
>
653 --disable=
<service
>
657 Enable/disable the service site-wide per default. Note
658 that a service disabled site-wide can still be enabled
659 per repository if it is marked overridable and the
660 repository enables the service with a configuration
665 --allow-override=
<service
>
668 --forbid-override=
<service
>
672 Allow/forbid overriding the site-wide default with per
673 repository configuration. By default, all the services
682 A directory to add to the whitelist of allowed directories. Unless
683 --strict-paths is specified this will also include subdirectories
684 of each named directory.
689 <h2 id=
"_services">SERVICES
</h2>
690 <div class=
"sectionbody">
691 <div class=
"paragraph"><p>These services can be globally enabled/disabled using the
692 command line options of this command. If a finer-grained
693 control is desired (e.g. to allow
<em>git archive
</em> to be run
694 against only in a few selected repositories the daemon serves),
695 the per-repository configuration file can be used to enable or
696 disable them.
</p></div>
697 <div class=
"dlist"><dl>
703 This serves
<em>git fetch-pack
</em> and
<em>git ls-remote
</em>
704 clients. It is enabled by default, but a repository can
705 disable it by setting
<tt>daemon.uploadpack
</tt> configuration
706 item to
<tt>false
</tt>.
714 This serves
<em>git archive --remote
</em>. It is disabled by
715 default, but a repository can enable it by setting
716 <tt>daemon.uploadarch
</tt> configuration item to
<tt>true
</tt>.
724 This serves
<em>git send-pack
</em> clients, allowing anonymous
725 push. It is disabled by default, as there is
<em>no
</em>
726 authentication in the protocol (in other words, anybody
727 can push anything into the repository, including removal
728 of refs). This is solely meant for a closed LAN setting
729 where everybody is friendly. This service can be
730 enabled by
<tt>daemon.receivepack
</tt> configuration item to
736 <h2 id=
"_examples">EXAMPLES
</h2>
737 <div class=
"sectionbody">
738 <div class=
"dlist"><dl>
740 We assume the following in /etc/services
743 <div class=
"listingblock">
744 <div class=
"content">
745 <pre><tt>$ grep
9418 /etc/services
746 git
9418/tcp # Git Version Control System
</tt></pre>
750 <em>git daemon
</em> as inetd server
754 To set up
<em>git daemon
</em> as an inetd service that handles any
755 repository under the whitelisted set of directories, /pub/foo
756 and /pub/bar, place an entry like the following into
757 /etc/inetd all on one line:
759 <div class=
"listingblock">
760 <div class=
"content">
761 <pre><tt> git stream tcp nowait nobody /usr/bin/git
762 git daemon --inetd --verbose --export-all
763 /pub/foo /pub/bar
</tt></pre>
767 <em>git daemon
</em> as inetd server for virtual hosts
771 To set up
<em>git daemon
</em> as an inetd service that handles
772 repositories for different virtual hosts,
<tt>www.example.com
</tt>
773 and
<tt>www.example.org
</tt>, place an entry like the following into
774 <tt>/etc/inetd
</tt> all on one line:
776 <div class=
"listingblock">
777 <div class=
"content">
778 <pre><tt> git stream tcp nowait nobody /usr/bin/git
779 git daemon --inetd --verbose --export-all
780 --interpolated-path=/pub/%H%D
781 /pub/www.example.org/software
782 /pub/www.example.com/software
785 <div class=
"paragraph"><p>In this example, the root-level directory
<tt>/pub
</tt> will contain
786 a subdirectory for each virtual host name supported.
787 Further, both hosts advertise repositories simply as
788 <tt>git://www.example.com/software/repo.git
</tt>. For pre-
1.4.0
789 clients, a symlink from
<tt>/software
</tt> into the appropriate
790 default repository could be made as well.
</p></div>
793 <em>git daemon
</em> as regular daemon for virtual hosts
797 To set up
<em>git daemon
</em> as a regular, non-inetd service that
798 handles repositories for multiple virtual hosts based on
799 their IP addresses, start the daemon like this:
801 <div class=
"listingblock">
802 <div class=
"content">
803 <pre><tt> git daemon --verbose --export-all
804 --interpolated-path=/pub/%IP/%D
805 /pub/
192.168.1.200/software
806 /pub/
10.10.220.23/software
</tt></pre>
808 <div class=
"paragraph"><p>In this example, the root-level directory
<tt>/pub
</tt> will contain
809 a subdirectory for each virtual host IP address supported.
810 Repositories can still be accessed by hostname though, assuming
811 they correspond to these IP addresses.
</p></div>
814 selectively enable/disable services per repository
818 To enable
<em>git archive --remote
</em> and disable
<em>git fetch
</em> against
819 a repository, have the following in the configuration file in the
820 repository (that is the file
<em>config
</em> next to
<em>HEAD
</em>,
<em>refs
</em> and
823 <div class=
"listingblock">
824 <div class=
"content">
827 uploadarch = true
</tt></pre>
832 <h2 id=
"_environment">ENVIRONMENT
</h2>
833 <div class=
"sectionbody">
834 <div class=
"paragraph"><p><em>git daemon
</em> will set REMOTE_ADDR to the IP address of the client
835 that connected to it, if the IP address is available. REMOTE_ADDR will
836 be available in the environment of hooks called when
837 services are performed.
</p></div>
839 <h2 id=
"_author">Author
</h2>
840 <div class=
"sectionbody">
841 <div class=
"paragraph"><p>Written by Linus Torvalds
<<a href=
"mailto:torvalds@osdl.org">torvalds@osdl.org
</a>>, YOSHIFUJI Hideaki
842 <<a href=
"mailto:yoshfuji@linux-ipv6.org">yoshfuji@linux-ipv6.org
</a>> and the git-list
<<a href=
"mailto:git@vger.kernel.org">git@vger.kernel.org
</a>></p></div>
844 <h2 id=
"_documentation">Documentation
</h2>
845 <div class=
"sectionbody">
846 <div class=
"paragraph"><p>Documentation by Junio C Hamano and the git-list
<<a href=
"mailto:git@vger.kernel.org">git@vger.kernel.org
</a>>.
</p></div>
848 <h2 id=
"_git">GIT
</h2>
849 <div class=
"sectionbody">
850 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
853 <div id=
"footer-text">
854 Last updated
2010-
11-
25 03:
13:
40 UTC