'What does git update-server-info do?
What does git update-server-info do? How do I know if I need it? The manual says:
A dumb server that does not do on-the-fly pack generations must have some auxiliary information files in $GIT_DIR/info and $GIT_OBJECT_DIRECTORY/info directories to help clients discover what references and packs the server has. This command generates such auxiliary files.
How do I know if my server is dumb, and whether it does or does not do "on-the-fly pack generations", and whether it "must have some auxiliary information files"?
I am pushing a web app via ssh to a bare repository, then pulling from that bare repository into the web root.
Solution 1:[1]
Dumb server basically means accessed over HTTP. So if you access your Git repository over http: or https: URLs, you need the update-server-info business, otherwise (git:, ssh:, etc.) you don't need it.
Solution 2:[2]
But do you have to execute
git update-server-infoafter every push to the repo?
A git repack can also use git update-server-info, updating the local catalog files needed to publish this repository (or a direct copy of it) over HTTP or FTP.
With Git 2.36 (Q2 2022), "git repack"(man) learned a new configuration to disable triggering of age-old update-server-info command, which is rarely useful these days (2022).
See commit a2565c4, commit 64a6151 (14 Mar 2022) by Patrick Steinhardt (pks-t).
(Merged by Junio C Hamano -- gitster -- in commit bfce3e7, 23 Mar 2022)
repack: add config to skip updating server infoSigned-off-by: Patrick Steinhardt
By default,
git-repackwill update server info that is required by the dumb HTTP transport.
This can be skipped by passing the-nflag, but what we're noticably missing is a config option to permanently disable updating this information.Add a new option "
repack.updateServerInfo" which can be used to disable the logic.
Most hosting providers have turned off the dumb HTTP protocol anyway, and on the client-side it wouldn't typically be useful either.
Giving a persistent way to disable this feature thus makes quite some sense to avoid wasting compute cycles and storage.
git config now includes in its man page:
repack.updateServerInfoIf set to false,
git repackwill not rungit update-server-info.Defaults to true. Can be overridden when true by the
-noption ofgit repack.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Peter Eisentraut |
| Solution 2 | VonC |
