Hanzo
OpenapiGit

Returns every file a glob selects at one revision, WITH its bytes and the…

Returns every file a glob selects at one revision, WITH its bytes and the revision they came from.

GET /v1/git/repos/{name}/files

Addresshttps://api.hanzo.ai/v1/git/repos/{name}/files
MethodGET
Operationget_git_repos_by_name_files
AuthAuthorization: Bearer $HANZO_API_KEY

Returns every file a glob selects at one revision, WITH its bytes and the revision they came from. It is the read a delivery generator makes: one call answers "what is the inventory at this commit, and what does it say", where listing and then fetching would be a request per file.

Returning the resolved revision matters as much as the bytes. A generator that lists at main and then reads at main can straddle a push and assemble half its inventory from one commit and half from the next; resolving once makes the whole read consistent by construction.

A file past the read cap comes back Truncated with no content rather than being dropped. A caller building a desired set has to know the difference between "this file is empty" and "this file was not read" — silently omitting it is how a pruning reconcile deletes what the missing file declared.

Request

3 fields.

FieldInTypeRequiredDescription
namepathstringyesName is the repo to read, from the :name path segment.
refquerystringRef is a branch, tag or commit; empty means the repo's HEAD.
globquerystringGlob selects files, matched segment by segment so * never crosses a /.

Response

StatusBodyMeaning
200filesJSONok

200 body — 7 fields.

FieldInTypeAlwaysDescription
filesbodyfileJSON[]Files are the selected files, sorted by path.
files[].contentbodystringContent is the file's bytes, empty when Truncated.
files[].encodingbodystringEncoding is how Content is carried: "utf8" verbatim, or "base64".
files[].pathbodystringPath is the file's repo-relative path.
files[].sizebodyintegerSize is the file's byte length in the repo.
files[].truncatedbodybooleanTruncated marks a file past the read cap; no content is sent.
revbodystringRev is the full revision the ref resolved to — pin follow-up reads to it.

Failure carries the platform error shape — see Errors.

Examples

hanzo git repos files <name>

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page