Hanzo
OpenapiGit

Lists a repo's branches, tags and default branch — what a branch picker needs…

Lists a repo's branches, tags and default branch — what a branch picker needs in one call.

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

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

Lists a repo's branches, tags and default branch — what a branch picker needs in one call. Unlike the other read ops it tolerates a repo with no commits: the ref sets come back empty and the default branch is still named.

Request

1 field.

FieldInTypeRequiredDescription
namepathstringyesName is the repo's org-unique handle, from the :name path segment.

Response

StatusBodyMeaning
200refsJSONok

200 body — 7 fields.

FieldInTypeAlwaysDescription
branchesbodyrefJSON[]Branches are the repo's heads; empty on a repo with no commits.
branches[].namebodystringName is the short ref name ("main", "v1.2.0"), not the full refs/… path.
branches[].shabodystringSHA is the full commit hash the ref resolves to.
defaultbodystringDefault is the branch name a caller gets when it asks for no ref.
tagsbodyrefJSON[]Tags are the repo's tags; empty when there are none.
tags[].namebodystringName is the short ref name ("main", "v1.2.0"), not the full refs/… path.
tags[].shabodystringSHA is the full commit hash the ref resolves to.

Failure carries the platform error shape — see Errors.

Examples

hanzo git repos refs <name>

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page