Zip: `git archive --format=zip -o latest.zip HEAD` (or rely on the .zip extension).
Prepend a prefix dir so extraction lands under a folder: `git archive --prefix=repo-1.2.0/ -o repo.tar.gz v1.2.0`.
Archive only a subdirectory at HEAD: `git archive --format=zip --prefix=docs/ -o docs.zip HEAD:Documentation/`.
List supported formats with `git archive --list`.
Known gotchas
git archive by default archives only TRACKED files; add untracked ones separately with --add-file=<path>.
Exclude files with an `export-ignore` attribute in .gitattributes; attributes are read from the archived tree by default (add --worktree-attributes to read working-tree file).
Archiving a commit stores commit time in the tar; archiving a raw tree-id ({tree}) uses current time.
git archive does not include submodule contents unless handled separately.
Give your agent this knowledge — and 17,000+ more routes
One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?