Allow multiple "git_path()" uses
[git.git] / Documentation / git-daemon.txt
blob741f2c69bdace527c57b644ed072ead4dcb46201
1 git-daemon(1)
2 =============
4 NAME
5 ----
6 git-daemon - A really simple server for git repositories
8 SYNOPSIS
9 --------
10 [verse]
11 'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
12              [--timeout=n] [--init-timeout=n] [--strict-paths]
13              [--base-path=path] [--user-path | --user-path=path]
14              [--enable=service] [--disable=service]
15              [--allow-override=service] [--forbid-override=service]
16              [--reuseaddr] [--detach] [--pid-file=file]
17              [--user=user [--group=group]] [directory...]
19 DESCRIPTION
20 -----------
21 A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT"
22 aka 9418.  It waits for a connection asking for a service, and will serve
23 that service if it is enabled.
25 It verifies that the directory has the magic file "git-daemon-export-ok", and
26 it will refuse to export any git directory that hasn't explicitly been marked
27 for export this way (unless the '--export-all' parameter is specified). If you
28 pass some directory paths as 'git-daemon' arguments, you can further restrict
29 the offers to a whitelist comprising of those.
31 By default, only `upload-pack` service is enabled, which serves
32 `git-fetch-pack` and `git-peek-remote` clients that are invoked
33 from `git-fetch`, `git-ls-remote`, and `git-clone`.
35 This is ideally suited for read-only updates, i.e., pulling from
36 git repositories.
38 OPTIONS
39 -------
40 --strict-paths::
41         Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
42         "/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
43         git-daemon will refuse to start when this option is enabled and no
44         whitelist is specified.
46 --base-path::
47         Remap all the path requests as relative to the given path.
48         This is sort of "GIT root" - if you run git-daemon with
49         '--base-path=/srv/git' on example.com, then if you later try to pull
50         'git://example.com/hello.git', `git-daemon` will interpret the path
51         as '/srv/git/hello.git'.
53 --export-all::
54         Allow pulling from all directories that look like GIT repositories
55         (have the 'objects' and 'refs' subdirectories), even if they
56         do not have the 'git-daemon-export-ok' file.
58 --inetd::
59         Have the server run as an inetd service. Implies --syslog.
61 --port::
62         Listen on an alternative port.
64 --init-timeout::
65         Timeout between the moment the connection is established and the
66         client request is received (typically a rather low value, since
67         that should be basically immediate).
69 --timeout::
70         Timeout for specific client sub-requests. This includes the time
71         it takes for the server to process the sub-request and time spent
72         waiting for next client's request.
74 --syslog::
75         Log to syslog instead of stderr. Note that this option does not imply
76         --verbose, thus by default only error conditions will be logged.
78 --user-path, --user-path=path::
79         Allow ~user notation to be used in requests.  When
80         specified with no parameter, requests to
81         git://host/~alice/foo is taken as a request to access
82         'foo' repository in the home directory of user `alice`.
83         If `--user-path=path` is specified, the same request is
84         taken as a request to access `path/foo` repository in
85         the home directory of user `alice`.
87 --verbose::
88         Log details about the incoming connections and requested files.
90 --reuseaddr::
91         Use SO_REUSEADDR when binding the listening socket.
92         This allows the server to restart without waiting for
93         old connections to time out.
95 --detach::
96         Detach from the shell. Implies --syslog.
98 --pid-file=file::
99         Save the process id in 'file'.
101 --user=user, --group=group::
102         Change daemon's uid and gid before entering the service loop.
103         When only `--user` is given without `--group`, the
104         primary group ID for the user is used.  The values of
105         the option are given to `getpwnam(3)` and `getgrnam(3)`
106         and numeric IDs are not supported.
108 Giving these options is an error when used with `--inetd`; use
109 the facility of inet daemon to achieve the same before spawning
110 `git-daemon` if needed.
112 --enable-service, --disable-service::
113         Enable/disable the service site-wide per default.  Note
114         that a service disabled site-wide can still be enabled
115         per repository if it is marked overridable and the
116         repository enables the service with an configuration
117         item.
119 --allow-override, --forbid-override::
120         Allow/forbid overriding the site-wide default with per
121         repository configuration.  By default, all the services
122         are overridable.
124 <directory>::
125         A directory to add to the whitelist of allowed directories. Unless
126         --strict-paths is specified this will also include subdirectories
127         of each named directory.
129 SERVICES
130 --------
132 upload-pack::
133         This serves `git-fetch-pack` and `git-peek-remote`
134         clients.  It is enabled by default, but a repository can
135         disable it by setting `daemon.uploadpack` configuration
136         item to `false`.
138 Author
139 ------
140 Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki
141 <yoshfuji@linux-ipv6.org> and the git-list <git@vger.kernel.org>
143 Documentation
144 --------------
145 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
149 Part of the gitlink:git[7] suite