Home Explore Blog CI



git

3rd chunk of `Documentation/git-daemon.adoc`
cbad93fec814d33712898fb688a5c6200c9ed8263dd6e0050000000100000d1f
	primary group ID for the user is used.  The values of
	the option are given to `getpwnam(3)` and `getgrnam(3)`
	and numeric IDs are not supported.
+
Giving these options is an error when used with `--inetd`; use
the facility of inet daemon to achieve the same before spawning
`git daemon` if needed.
+
Like many programs that switch user id, the daemon does not reset
environment variables such as `HOME` when it runs git programs,
e.g. `upload-pack` and `receive-pack`. When using this option, you
may also want to set and export `HOME` to point at the home
directory of _<user>_ before starting the daemon, and make sure any
Git configuration files in that directory are readable by _<user>_.

`--enable=<service>`::
`--disable=<service>`::
	Enable/disable the service site-wide per default.  Note
	that a service disabled site-wide can still be enabled
	per repository if it is marked overridable and the
	repository enables the service with a configuration
	item.

`--allow-override=<service>`::
`--forbid-override=<service>`::
	Allow/forbid overriding the site-wide default with per
	repository configuration.  By default, all the services
	may be overridden.

`--informative-errors`::
`--no-informative-errors`::
	When informative errors are turned on, git-daemon will report
	more verbose errors to the client, differentiating conditions
	like "no such repository" from "repository not exported". This
	is more convenient for clients, but may leak information about
	the existence of unexported repositories.  When informative
	errors are not enabled, all errors report "access denied" to the
	client. The default is `--no-informative-errors`.

`--access-hook=<path>`::
	Every time a client connects, first run an external command
	specified by the <path> with service name (e.g. "upload-pack"),
	path to the repository, hostname (`%H`), canonical hostname
	(`%CH`), IP address (`%IP`), and TCP port (`%P`) as its command-line
	arguments. The external command can decide to decline the
	service by exiting with a non-zero status (or to allow it by
	exiting with a zero status).  It can also look at the $REMOTE_ADDR
	and `$REMOTE_PORT` environment variables to learn about the
	requestor when making this decision.
+
The external command can optionally write a single line to its
standard output to be sent to the requestor as an error message when
it declines the service.

_<directory>_::
	The remaining arguments provide a list of directories. If any
	directories are specified, then the `git-daemon` process will
	serve a requested directory only if it is contained in one of
	these directories. If `--strict-paths` is specified, then the
	requested directory must match one of these directories exactly.

SERVICES
--------

These services can be globally enabled/disabled using the
command-line options of this command.  If finer-grained
control is desired (e.g. to allow `git archive` to be run
against only in a few selected repositories the daemon serves),
the per-repository configuration file can be used to enable or
disable them.

upload-pack::
	This serves `git fetch-pack` and `git ls-remote`
	clients.  It is enabled by default, but a repository can
	disable it by setting `daemon.uploadpack` configuration
	item to `false`.

upload-archive::
	This serves `git archive --remote`.  It is disabled by
	default, but a repository can enable

Title: Git Daemon Configuration and Services
Summary
The git-daemon command provides options for configuring user and group settings, enabling or disabling services, and customizing error messages, as well as support for access hooks and per-repository configuration, allowing for fine-grained control over Git services such as upload-pack and upload-archive, which can be globally enabled or disabled and also configured at the repository level for more precise access control.