Home Explore Blog CI



git

1st chunk of `Documentation/git-daemon.adoc`
00458fb4e1ac726de74a2f352f439f7ed8cf069ed965dc560000000100000fa2
git-daemon(1)
=============

NAME
----
git-daemon - A really simple server for Git repositories

SYNOPSIS
--------
[synopsis]
git daemon [--verbose] [--syslog] [--export-all]
	   [--timeout=<n>] [--init-timeout=<n>] [--max-connections=<n>]
	   [--strict-paths] [--base-path=<path>] [--base-path-relaxed]
	   [--user-path | --user-path=<path>]
	   [--interpolated-path=<pathtemplate>]
	   [--reuseaddr] [--detach] [--pid-file=<file>]
	   [--enable=<service>] [--disable=<service>]
	   [--allow-override=<service>] [--forbid-override=<service>]
	   [--access-hook=<path>] [--[no-]informative-errors]
	   [--inetd |
	     [--listen=<host-or-ipaddr>] [--port=<n>]
	     [--user=<user> [--group=<group>]]]
	   [--log-destination=(stderr|syslog|none)]
	   [<directory>...]

DESCRIPTION
-----------
A really simple TCP Git daemon that normally listens on port "DEFAULT_GIT_PORT"
aka 9418.  It waits for a connection asking for a service, and will serve
that service if it is enabled.

It verifies that the directory has the magic file "git-daemon-export-ok", and
it will refuse to export any Git directory that hasn't explicitly been marked
for export this way (unless the `--export-all` parameter is specified). If you
pass some directory paths as `git daemon` arguments, the offers are limited to
repositories within those directories.

By default, only `upload-pack` service is enabled, which serves
`git fetch-pack` and `git ls-remote` clients, which are invoked
from `git fetch`, `git pull`, and `git clone`.

This is ideally suited for read-only updates, i.e., pulling from
Git repositories.

An `upload-archive` also exists to serve `git archive`.

OPTIONS
-------
`--strict-paths`::
	Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
	"/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
	`git daemon` will refuse to start when this option is enabled and no
	directory arguments are provided.

`--base-path=<path>`::
	Remap all the path requests as relative to the given path.
	This is sort of "Git root" - if you run `git daemon` with
	`--base-path=/srv/git` on `example.com`, then if you later try
	to pull from `git://example.com/hello.git`, `git daemon` will
	interpret the path as `/srv/git/hello.git`.

`--base-path-relaxed`::
	If `--base-path` is enabled and repo lookup fails, with this option
	`git daemon` will attempt to lookup without prefixing the base path.
	This is useful for switching to `--base-path` usage, while still
	allowing the old paths.

`--interpolated-path=<pathtemplate>`::
	To support virtual hosting, an interpolated path template can be
	used to dynamically construct alternate paths.  The template
	supports `%H` for the target hostname as supplied by the client but
	converted to all lowercase, `%CH` for the canonical hostname,
	`%IP` for the server's IP address, `%P` for the port number,
	and `%D` for the absolute path of the named repository.
	After interpolation, the path is validated against the directory
	list.

`--export-all`::
	Allow pulling from all directories that look like Git repositories
	(have the 'objects' and 'refs' subdirectories), even if they
	do not have the `git-daemon-export-ok` file.

`--inetd`::
	Have the server run as an inetd service. Implies `--syslog` (may
	be overridden with `--log-destination=`).
	Incompatible with `--detach`, `--port`, `--listen`, `--user` and
	`--group` options.

`--listen=<host-or-ipaddr>`::
	Listen on a specific IP address or hostname.  IP addresses can
	be either an IPv4 address or an IPv6 address if supported.  If IPv6
	is not supported, then `--listen=<hostname>` is also not supported
	and `--listen` must be given an IPv4 address.
	Can be given more than once.
	Incompatible with `--inetd` option.

`--port=<n>`::
	Listen on an alternative port.  Incompatible with `--inetd` option.

`--init-timeout=<n>`::
	Timeout (in seconds) between the moment the connection is established
	and the client request is received (typically a rather low value, since
	that

Title: Git Daemon Documentation
Summary
The git-daemon is a simple TCP server for Git repositories, which listens for connections and serves enabled services such as upload-pack and upload-archive, ideal for read-only updates and repository access.