Skip to content

Repositories

A link to download a branch, tag or commit as a gzipped tar archive (the default branch without ref), good for 10 minutes and needing no token.

GET/repos/{owner}/{name}/tarball/{ref}

Over REST, GET …/tarball/{ref} answers 302 with the link in Location, as GitHub does: curl -L follows it. Over MCP the link is returned as url, with commit and expires_at. The archive holds one folder, <owner>-<repo>-<first 7 of the commit>/, with executable files and symlinks as git has them and the commit in its pax header. Up to 10,000 files and 24 MB; clone a larger repository. Needs the Read role; a public repository’s are open to anyone.

Over REST the answer is 302 Found with the link in Location, as GitHub’s is, so curl -L -H "Authorization: Bearer g1t_…" -o hello.tar.gz https://api.g1t.sh/repos/flagon-io/hello/tarball/main saves the file and tar -xzf hello.tar.gz makes one folder, flagon-io-hello-7c1e9a4/; the body above is what the MCP repository tool’s tarball returns. The link is for the commit the ref named when you asked, needs no token and stops working after 10 minutes. actions/checkout uses this route in a job container without git.

  • Authentication: Optional. Public data can be read without a token; send one to see what is private.
  • MCP tool: repository with action tarball, and the same inputs
  • Scope: An access token needs code:read.
Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.
ref string Yes A branch, tag or commit; the default branch when left out. A branch with slashes is sent URL-encoded as one path segment.
curl https://api.g1t.sh/repos/flagon-io/hello/tarball/main \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"url": "https://g1t.sh/flagon-io/hello/archive/7c1e9a4b2d6f80135ac9e2b7d4f6a8c0e1b3d5f7.tar.gz?token=…",
"commit": "7c1e9a4b2d6f80135ac9e2b7d4f6a8c0e1b3d5f7",
"expires_at": "2026-10-12T15:13:00.000Z"
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
422 invalid The input is not valid. message says which field and why.