Skip to main content
Archil Git hosting gives you git repos that you create and manage from code. Each repo is an Archil disk in your own account, served by a small git service that also runs in your account. Your agents and users clone, fetch, and push over HTTPS with ordinary git, using tokens you mint per repo.
  • Git over HTTPS: standard git clone, fetch, and push, with scoped, expiring tokens. git never sees your API key.
  • Git LFS: works with no setup. LFS objects are stored on the repo’s disk.
  • Commit without git: make a commit from a list of file changes with one API call, without a clone. See Commit without git.
  • Instant forks: a fork is a copy-on-write copy of the repo’s disk, ready in about a second whatever the repo’s size. See Forks.
  • Push webhooks: one signed webhook per account for every push and commit. See Push webhooks.
  • Read without cloning: list refs, browse trees, read files, page through history, and compare branches over HTTPS.
  • In your account: repos, the git service, and its state are disks and sandboxes in your account. The service keeps itself up to date and pauses when idle.
Git hosting is in preview, and the API may change before 1.0. Enable it from Git hosting in the Archil console. Questions and feedback go to support@archil.com.

Quickstart

1. Enable Git hosting

  1. In the Archil console, open Git hosting in the workspace that should hold your repos, and enable it. The console sets up the git service in your account.
  2. Copy the endpoint that page shows. This is your git endpoint: the SDK sends every Git hosting call there, and your repos’ remote URLs are on it.
  3. Use an API key from the same workspace.

2. Configure the SDK

Install the SDK and pass the endpoint to the Archil client. If you don’t pass it, the SDK reads ARCHIL_GIT_URL.
Without an endpoint, every archil.git call fails with an ArchilGitError whose code is not_configured, before any request is sent.

3. Create a repo

The default branch is main. Pass defaultBranch (default_branch in Python) to change it.

4. Mint a token and push

git and Git LFS accept only tokens that you mint for specific repos, never your API key. A read token can clone and fetch. A write token can push too. tokens.credentials() mints a token for one repo and returns env: environment variables that make git send the token to your git endpoint. Passing the token this way keeps it out of .git/config and off the command line.
To hand a token to someone or something else, mint it directly. A token can cover several repos:
For other ways to give git a token, such as a credential helper, see Tokens.

5. Read a file without cloning

See the read API for refs, streaming large files, and comparing branches.

How it works

Enabling Git hosting creates a few resources in your account, all in the workspace and region you enabled it in:
  • The git service, which runs as Archil sandboxes. One of them serves your git endpoint. Repos are spread over shards, 4 by default, and each shard is a sandbox that starts when the first repo is placed on it. To change the number of shards, see Shards.
  • A disk per repo. The repo’s git objects, refs, and LFS objects live on it. repo.diskId names it.
  • A small state disk that holds the service’s own records, such as your repos and webhook settings.
The service’s sandboxes pause after a few minutes without requests and resume on the next one, so a quiet account doesn’t keep them running. The service also keeps itself up to date. Manage repos through the SDK rather than by changing these disks and sandboxes directly: deleting one of them yourself can break the service or lose repos.

Limits

Performance

From an agent sandbox in AWS us-west-2, a warm push of a small commit took 119 ms at p50, a fetch 110 ms, and an ls-remote 65 ms. code.storage is faster per small operation today. At 50 concurrent clients, Archil came within 6% of code.storage’s push rate, and it was the fastest of the services we measured on full and blobless clones of git.git and on 100 MB LFS downloads. The first operation on a repo that has been idle for hours takes about half a second longer. See Git hosting performance for every number, the method, and where Archil is slower.

Next steps

SDK reference

Repos, tokens, the read API, shards, and errors, in TypeScript and Python.

Give an agent sandbox a repo

Clone into a sandbox with a short-lived token and push the agent’s work back.

Commit without git

Write files to a branch with one API call.

Forks

Copy a repo of any size in about a second.