Skip to main content
Clone a repository into a runtime, change files, and push. Each call returns git’s exit code, stdout, and stderr.

Clone and commit

Clone, fetch, pull, and push need a network policy. See network access.
A destination directory that does not exist yet is created, including any missing parent directories.

Work in the checkout

Install dependencies and run tests in the cloned tree.

Authenticate a private remote

Pass auth_token on each call that contacts the remote. The token is sent as an HTTP Authorization header for that call and is not written into the repository, so a later pull, fetch, or push needs the token again.
On push, auth_token takes precedence over username and password. The CLI reads GRAVIXLAYER_GIT_TOKEN when --auth-token is omitted.

Run any other git command

git log, git diff, rebase, submodules, and tags go through Run a shell command.

Read the result

Every operation returns the same shape: success: false means git reported a failure, such as a merge conflict or a rejected push. The HTTP status is still 200. Check success: git writes progress to stderr, so a non-empty stderr on its own is not a failure. The CLI exits with git’s own exit code:
Operations that contact a remote default to 300 seconds and accept timeout_seconds up to 900. Operations that stay in the local repository allow up to 120 seconds. Use depth on clone to keep a large repository inside the limit.

Endpoints

The same calls are on the async client as await client.runtime.git.<operation>(runtime_id, ...).