SandboxesGit

Get git status

Return the branch, upstream and changed files of the work tree that contains path.

  • Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters.
  • Served at the access endpoint of the sandbox (access_endpoint of GET /v1/sandboxes/{sandboxId}), not at the API host.
  • A paused sandbox returns 409, unless resume=true. A sandbox that started before its files server existed returns 409 sandbox_update_required until it restarts.
  • A refused operation returns its code as the problem type.
  • A path that starts with ~ or ~/ names the home directory of the user that the operation runs as. ~name returns 422.
GET
/v1/sandboxes/{sandboxId}/git/status
AuthorizationBearer <token>

API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.

In: header

Path Parameters

sandboxId*string

Sandbox ID (ULID)

Query Parameters

path?string

A directory inside the work tree: absolute, or relative to the sandbox working directory

Default"."
resume?boolean

Wake a paused sandbox to serve this request

Response Body

application/json

application/problem+json

curl -X GET "https://example.com/v1/sandboxes/string/git/status"
{  "ahead": 0,  "behind": 0,  "branch": "string",  "files": [    {      "index_status": "string",      "old_path": "string",      "path": "string",      "status": "added",      "worktree_status": "string"    }  ],  "head": "string",  "root": "string",  "truncated": true,  "upstream": "string"}

Get a git patch GET

Return the staged, unstaged and untracked, not ignored changes against `base` as one unified patch. - Run `git apply -p1` in the work tree root to apply it. Binary files are included. - A patch above 6 MiB stops after its last complete file and sets `Tektona-Git-Truncated: true`. - The index of the repository does not change. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.

Initialise a repository POST

Create a git repository at `path`, with `initial_branch` as the first branch, and return its root. - Git creates a missing directory. - Local git writes on one work tree run one at a time. A write through the files endpoints does not wait for them. After a timeout, the outcome is unknown: the command can have run. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.