git-update-server-info
Update auxiliary info files so dumb Git servers can serve a repository
TLDR
SYNOPSIS
git update-server-info [-f | --force]
DESCRIPTION
git update-server-info writes the auxiliary index files that allow a "dumb" HTTP, FTP, or rsync server to serve a Git repository without running any Git-aware service. A dumb server simply delivers raw files from disk, so it cannot enumerate refs or generate packs on the fly. The auxiliary files give clients enough metadata to discover what references and packs exist.The command regenerates objects/info/packs, which lists every pack file in the object store, and info/refs, which lists every reference with its target object name. Clients fetching over a dumb transport read these files to plan what objects they need to download.This step is unnecessary for repositories served by git-daemon, git-http-backend, or any other "smart" transport, because those services compute the same information on demand. It is only required for plain file servers such as Apache without the smart Git CGI, S3 buckets exposed over HTTP, or static hosting providers.The stock post-update hook shipped with Git invokes this command, so enabling it on the server is usually the only setup needed. After every push, the hook refreshes the info files so subsequent dumb clients see the latest state.
PARAMETERS
-f, --force
Update the info files from scratch, ignoring any cached or partial state. Useful after manual repacking, when packs have been added or removed outside of Git's normal flow, or when the info files appear out of sync with the repository contents.
CONFIGURATION
Enable the auto-update hook on the server-side bare repository:
chmod +x hooks/post-update
OUTPUT FILES
objects/info/packs
One P pack-_xxx_.pack line per pack in the object store. Dumb clients read this to learn which pack files they may need to download.info/refs
One sha1 TAB refname line for every loose and packed ref. This is the dumb-transport equivalent of the ref advertisement that smart transports send.
CAVEATS
Forgetting to run this command on a dumb server leaves clients seeing a stale view: pushed commits, new branches, and freshly created packs remain invisible until the info files are refreshed. The bundled post-update sample hook fixes this, but it must be made executable, since Git ships it with the .sample suffix and only the renamed version runs.Running the command on a working tree is harmless but rarely useful, since local access uses the object database directly and never consults the info files.
HISTORY
The dumb HTTP transport and its helper commands appeared in early Git releases, when smart transports over HTTP did not yet exist and many sites only had access to plain static web servers. Today git update-server-info is mostly a legacy compatibility tool, still maintained because some hosting setups (object storage, locked-down corporate proxies, archival mirrors) cannot run a smart Git service.
SEE ALSO
git(1), git-daemon(1), git-repack(1)
