GIT-UPLOAD-ARCHIVE(1)
π GIT-UPLOAD-ARCHIVE(1) π
ok so bestie, welcome to the git-upload-archive handbook β that's page one of the git manual, and honestly? she's a niche queen but she ATE. let's get into it π
β¨ NAME β¨
git-upload-archive β literally just sending an archive right back to git-archive, no cap π¦
β¨ SYNOPSIS β¨
git upload-archive <repository>
πΈ DESCRIPTION πΈ
so here's the vibe: this girl gets invoked by git archive --remote, and her whole job is to send a freshly generated archive to the other end over the Git protocol. iconic teamwork, fr fr π«Ά
and like β she's usually not something you call up directly yourself. nope. the actual UI for the protocol lives on the git archive side, and these two are a program pair, a little duo, meant to be used together so you can pull an archive from a remote repository. main character energy but make it a two-piece π«
π SECURITY π
ok bestie this is the part where we get serious for a sec, because privacy is real π
so β objects get removed from history, right? but they might not be pruned yet. and to protect the privacy of those little ghosts, git-upload-archive straight-up avoids serving archives for commits and trees that aren't reachable from the repository's refs. she's not gonna leak the ex, periodt π
BUT (and here's the plot twist) calculating object reachability is computationally expensive π so instead she implements a stricter but way easier-to-check set of rules:
- Clients may request a commit or tree that is pointed to directly by a ref. E.g.,
git archive --remote=origin v1.0. cute, allowed β¨ - Clients may request a sub-tree within a commit or tree using the
ref:pathsyntax. E.g.,git archive --remote=origin v1.0:Documentation. also allowed, slay π - Clients may not use other sha1 expressions β even if the end result is reachable. E.g., neither a relative commit like
master^nor a literal sha1 likeabcd1234is allowed, even if the result is reachable from the refs. nope, not today π
lowkey note: rule 3 disallows many cases that don't have any privacy implications at all. and heads up β these rules are subject to change in future versions of git, and the server accessed by git archive --remote may or may not follow these exact rules. so like, vibe check your server, iykyk π
and if the config option uploadArchive.allowUnreachable is true? then these rules are straight-up ignored, and clients may use arbitrary sha1 expressions. super useful if you do not care about the privacy of unreachable objects, or if your object database is already publicly available for access via non-smart-http. she said "transparency era" π
π¦ OPTIONS π¦
<repository>β the repository to get a tar archive from. that's it, that's the option, she's simple and she's stunning π
π GIT π
part of the git(1) suite, obviously β she runs with a whole crew π
πΈπβ¨ and that's the whole page, bestie! this one's from Git 2.56.0, dated 2026-09-27 β so like, future git, we love to see it π§ββοΈπ« mwah, go archive something cute π
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms