blob: 51d7c94d7df0c15a74855f5ef910def64045681e [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-daemon(1)
2=============
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-daemon - A really simple server for git repositories
Junio C Hamano1a4e8412005-12-27 08:17:237
8SYNOPSIS
9--------
Junio C Hamano235a91e2006-01-07 01:13:5810[verse]
Junio C Hamano1a4e8412005-12-27 08:17:2311'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
Junio C Hamano4d04a402006-01-09 00:53:2812 [--timeout=n] [--init-timeout=n] [--strict-paths]
Junio C Hamano70fafca2006-02-06 08:02:0113 [--base-path=path] [--user-path | --user-path=path]
Junio C Hamano47c1e3c2006-09-25 04:45:5514 [--interpolated-path=pathtemplate]
Junio C Hamano19ed3682006-09-07 11:44:0815 [--enable=service] [--disable=service]
16 [--allow-override=service] [--forbid-override=service]
17 [--reuseaddr] [--detach] [--pid-file=file]
18 [--user=user [--group=group]] [directory...]
Junio C Hamano1a4e8412005-12-27 08:17:2319
20DESCRIPTION
21-----------
22A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT"
Junio C Hamano19ed3682006-09-07 11:44:0823aka 9418. It waits for a connection asking for a service, and will serve
24that service if it is enabled.
Junio C Hamano1a4e8412005-12-27 08:17:2325
26It verifies that the directory has the magic file "git-daemon-export-ok", and
27it will refuse to export any git directory that hasn't explicitly been marked
28for export this way (unless the '--export-all' parameter is specified). If you
29pass some directory paths as 'git-daemon' arguments, you can further restrict
30the offers to a whitelist comprising of those.
31
Junio C Hamano19ed3682006-09-07 11:44:0832By default, only `upload-pack` service is enabled, which serves
33`git-fetch-pack` and `git-peek-remote` clients that are invoked
34from `git-fetch`, `git-ls-remote`, and `git-clone`.
35
36This is ideally suited for read-only updates, i.e., pulling from
37git repositories.
Junio C Hamano1a4e8412005-12-27 08:17:2338
39OPTIONS
40-------
41--strict-paths::
42Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
43"/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
44git-daemon will refuse to start when this option is enabled and no
45whitelist is specified.
46
Junio C Hamano4d04a402006-01-09 00:53:2847--base-path::
48Remap all the path requests as relative to the given path.
49This is sort of "GIT root" - if you run git-daemon with
50'--base-path=/srv/git' on example.com, then if you later try to pull
51'git://example.com/hello.git', `git-daemon` will interpret the path
Junio C Hamano70fafca2006-02-06 08:02:0152as '/srv/git/hello.git'.
Junio C Hamano4d04a402006-01-09 00:53:2853
Junio C Hamano47c1e3c2006-09-25 04:45:5554--interpolated-path=pathtemplate::
55To support virtual hosting, an interpolated path template can be
56used to dynamically construct alternate paths. The template
57supports %H for the target hostname as supplied by the client,
58and %D for the absolute path of the named repository.
59
Junio C Hamano1a4e8412005-12-27 08:17:2360--export-all::
61Allow pulling from all directories that look like GIT repositories
62(have the 'objects' and 'refs' subdirectories), even if they
63do not have the 'git-daemon-export-ok' file.
64
65--inetd::
66Have the server run as an inetd service. Implies --syslog.
67
68--port::
69Listen on an alternative port.
70
71--init-timeout::
72Timeout between the moment the connection is established and the
73client request is received (typically a rather low value, since
74that should be basically immediate).
75
76--timeout::
77Timeout for specific client sub-requests. This includes the time
78it takes for the server to process the sub-request and time spent
79waiting for next client's request.
80
81--syslog::
82Log to syslog instead of stderr. Note that this option does not imply
83--verbose, thus by default only error conditions will be logged.
84
Junio C Hamano70fafca2006-02-06 08:02:0185--user-path, --user-path=path::
86Allow ~user notation to be used in requests. When
87specified with no parameter, requests to
88git://host/~alice/foo is taken as a request to access
89'foo' repository in the home directory of user `alice`.
90If `--user-path=path` is specified, the same request is
91taken as a request to access `path/foo` repository in
92the home directory of user `alice`.
93
Junio C Hamano1a4e8412005-12-27 08:17:2394--verbose::
95Log details about the incoming connections and requested files.
96
Junio C Hamanoabb53dc2006-07-28 05:14:1297--reuseaddr::
98Use SO_REUSEADDR when binding the listening socket.
99This allows the server to restart without waiting for
100old connections to time out.
101
102--detach::
103Detach from the shell. Implies --syslog.
104
105--pid-file=file::
106Save the process id in 'file'.
107
Junio C Hamano9adfc6a2006-08-28 07:18:38108--user=user, --group=group::
109Change daemon's uid and gid before entering the service loop.
110When only `--user` is given without `--group`, the
111primary group ID for the user is used. The values of
112the option are given to `getpwnam(3)` and `getgrnam(3)`
113and numeric IDs are not supported.
114+
115Giving these options is an error when used with `--inetd`; use
116the facility of inet daemon to achieve the same before spawning
117`git-daemon` if needed.
118
Junio C Hamano19ed3682006-09-07 11:44:08119--enable-service, --disable-service::
120Enable/disable the service site-wide per default. Note
121that a service disabled site-wide can still be enabled
122per repository if it is marked overridable and the
123repository enables the service with an configuration
124item.
125
126--allow-override, --forbid-override::
127Allow/forbid overriding the site-wide default with per
128repository configuration. By default, all the services
129are overridable.
130
Junio C Hamano1a4e8412005-12-27 08:17:23131<directory>::
132A directory to add to the whitelist of allowed directories. Unless
133--strict-paths is specified this will also include subdirectories
134of each named directory.
135
Junio C Hamano19ed3682006-09-07 11:44:08136SERVICES
137--------
138
139upload-pack::
140This serves `git-fetch-pack` and `git-peek-remote`
141clients. It is enabled by default, but a repository can
142disable it by setting `daemon.uploadpack` configuration
143item to `false`.
144
Junio C Hamano47c1e3c2006-09-25 04:45:55145EXAMPLES
146--------
147git-daemon as inetd server::
148To set up `git-daemon` as an inetd service that handles any
149repository under the whitelisted set of directories, /pub/foo
150and /pub/bar, place an entry like the following into
151/etc/inetd all on one line:
152+
153------------------------------------------------
154git stream tcp nowait nobody /usr/bin/git-daemon
155git-daemon --inetd --verbose
156--syslog --export-all
157/pub/foo /pub/bar
158------------------------------------------------
159
160
161git-daemon as inetd server for virtual hosts::
162To set up `git-daemon` as an inetd service that handles
163repositories for different virtual hosts, `www.example.com`
164and `www.example.org`, place an entry like the following into
165`/etc/inetd` all on one line:
166+
167------------------------------------------------
168git stream tcp nowait nobody /usr/bin/git-daemon
169git-daemon --inetd --verbose
170--syslog --export-all
171--interpolated-path=/pub/%H%D
172/pub/www.example.org/software
173/pub/www.example.com/software
174/software
175------------------------------------------------
176+
177In this example, the root-level directory `/pub` will contain
178a subdirectory for each virtual host name supported.
179Further, both hosts advertise repositories simply as
180`git://www.example.com/software/repo.git`. For pre-1.4.0
181clients, a symlink from `/software` into the appropriate
182default repository could be made as well.
183
184
Junio C Hamano1a4e8412005-12-27 08:17:23185Author
186------
187Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki
188<yoshfuji@linux-ipv6.org> and the git-list <git@vger.kernel.org>
189
190Documentation
191--------------
192Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
193
194GIT
195---
196Part of the gitlink:git[7] suite
197