Progress:
TIER 3 · MODULE 49· Expert

git update-server-info

What dumb-HTTP servers need run after each push.

🎯 What & why

git update-server-info rewrites the static metadata files that a dumb-HTTP server needs to advertise refs and packs. Run it on the remote after every push when the server has no Git CGI of its own.

🧠 Mental model

Dumb HTTP is just Apache serving files. Without server-side Git, the client cannot ask 'what refs do you have?' -- so we pre-bake the answer into info/refs and objects/info/packs and let the static server hand those files out.

🛠️ Synopsis

git update-server-info [-f | --force]

Regenerates `info/refs` (one line per ref: SHA TAB refname) and `objects/info/packs` (one line per packfile). Runs in the current repo (typically a bare repo behind the web root).

🎚️ Switches & options

FlagWhat it does
-f, --forceRewrite the info files even when they look up to date.
(implicit) info/refsGenerated under <gitdir>/info/refs for ref discovery.
(implicit) objects/info/packsGenerated alongside packfiles so clients can enumerate them.
(implicit) post-update hookThe shipped sample hook in hooks/post-update.sample is just exec git update-server-info.

💡 Use cases

🧪 Examples

Refresh after a push
git update-server-info
Force a rewrite
git update-server-info -f
Enable the shipped hook
mv hooks/post-update.sample hooks/post-update
Publish a bare mirror
git clone --bare repo.git && cd repo.git && git update-server-info

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.