Streams a tarball back across the wire.
git upload-archive is the server-side counterpart of git archive --remote=.... It streams a tarball/zip of a tree back over the wire so clients can fetch a snapshot without cloning the whole repo.
Same shape as upload-pack but for archives: client asks for a ref+format, server runs git archive and pipes the bytes back through the same transport (SSH or git://).
git upload-archive <directory>
# Enable on git-daemon side
git config daemon.uploadarch true
# Client side that triggers it
git archive --remote=<url> --format=tar HEAD | tar x| Flag | What it does |
|---|---|
<directory> | The repository path the daemon/SSH wrapper passes in |
(none else) | This is a transport endpoint — flags come from the client's git archive invocation |
daemon.uploadarch=true | Required config on git daemon to allow this verb at all |
uploadArchive.allowUnreachable=true | Permits archiving commits not on any branch (off by default) |
git config daemon.uploadarch truegit archive --remote=git://127.0.0.1/myrepo.git --format=tar v1.2.0 | tar xgit archive --remote=git@127.0.0.1:myrepo.git --format=tar.gz HEAD > snap.tgzgit config uploadArchive.allowUnreachable truedaemon.uploadarch off unless you actually want anonymous tarball downloads — it's off for a reasongit daemon has no authdaemon.uploadarch true and getting a confusing 'service not enabled' errorallowUnreachable and accidentally exposing dangling/secret commits that were never mergedHit each option, then Check answers. Score is recorded; Next is always open.