The simplest possible Git server. No auth, no encryption.
git daemon is the reference server for the git:// protocol — a tiny TCP listener that speaks the native pack protocol on port 9418. No auth, no encryption.
Think 'anonymous read-only mirror'. The daemon multiplexes upload-pack (and optionally receive-pack) over a raw TCP socket; transport security, if you want any, is somebody else's problem (VPN, SSH tunnel, firewall).
git daemon [--verbose] [--syslog] [--export-all] [--timeout=<n>]
[--init-timeout=<n>] [--max-connections=<n>] [--strict-paths]
[--base-path=<path>] [--base-path-relaxed] [--user-path[=<path>]]
[--interpolated-path=<fmt>] [--reuseaddr] [--detach]
[--pid-file=<file>] [--user=<user> [--group=<group>]]
[--enable=<service>] [--disable=<service>]
[--allow-override=<service>] [--forbid-override=<service>]
[--access-hook=<path>] [--[no-]informative-errors]
[--inetd | [--listen=<host>] [--port=<n>]]
[--log-destination=(stderr|syslog|none)] [<directory>...]| Flag | What it does |
|---|---|
--export-all | Serve every repo under base-path, not just those with git-daemon-export-ok |
--base-path=<path> | Treat <path> as the root for all incoming repo paths |
--listen=<addr> | Bind to a specific interface (default: all) |
--port=<n> | Listen on this TCP port (default: 9418) |
--enable=<service> | Enable a service (e.g. receive-pack — usually a bad idea) |
--disable=<service> | Disable a service (upload-pack, upload-archive, receive-pack) |
--inetd | Run as an inetd-managed service (one connection per invocation) |
--detach | Detach from the controlling terminal — daemonize |
--pid-file=<file> | Write the daemon PID here for init scripts |
--user=<user> | Drop privileges to this user after binding |
--group=<group> | Drop to this group (requires --user) |
--syslog | Log to syslog instead of stderr |
--log-destination=<dest> | Pick stderr, syslog, or none explicitly |
--enable=receive-pack | ⚠️ Allow anonymous push — almost never what you want |
git daemon --reuseaddr --base-path=/srv/git --export-all --listen=127.0.0.1 --port=9418git daemon --verbose --base-path=/srv/git --export-all --listen=127.0.0.1git daemon --detach --user=git --group=git --syslog --pid-file=/run/git-daemon.pid --base-path=/srv/git --export-allgit clone git://127.0.0.1/myrepo.gitHit each option, then Check answers. Score is recorded; Next is always open.