# Repository Briefing: feder-cr/git-ai
> Source: https://repoforai.com/repo/feder-cr/git-ai (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/feder-cr/git-ai
- **Official Docs / Website**: https://www.anthropic.com/engineering/redesigning-source-control
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Go
- **License**: See repository
- **Engineering Health**: A (77/100 · Maintenance 35/35 · Adoption 16/25 · Releases 20/20 · License 6/20)
- **Latest Release**: v0.4.2 (2026-11-05) — https://github.com/feder-cr/git-ai/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted, CLI
- **Momentum**: 935 ★ total (+1 24h / +25 7d) · 95 forks
- **Topics**: `ai-agents`, `coding-agents`, `git`, `golang`, `pando`, `scion`, `version-control`
- **When to Use**: Best for: Platform teams running many short-lived coding agents or CI workers against shared hot branches, where checkout traffic and write retries are measurable costs and the team can own storage and recovery. Skip if: Conventional Git hosting already meets your needs, offline-first work is essential, or you require proven cross-host and cloud-bucket operation without running your own qualification.

## Overview
```text
### Architecture & Core Mechanics
gitai is a Go fork of Gitaly that keeps ordinary Git repositories underneath and adds a server-centric workflow called Graft. Agents and CI use the `graft` CLI or Go SDK over gRPC, optionally through `graft-cache`. The server handles object retrieval, landing, changesets, derived history, search, and review. `UserLand` rebases a change onto the current branch tip and uses a per-reference compare-and-swap (CAS); concurrent lands on the same branch can share one reference update.

The storage core separates metadata from Git payloads. SQLite for single-node operation or PostgreSQL holds references, the changeset write-ahead log, changelog, and review state; content-addressed packs go to file-backed storage, S3, GCS, or Azure. With the storage core authoritative, local Git repositories serve as rebuildable caches. `go.mod` targets Go 1.26.0 and includes the Google Cloud Storage, Azure Blob, and AWS S3 SDKs. Conflict resolution is an extension point with a versioned, provider-neutral protocol rather than an embedded model runtime.

### Key Capabilities & Differentiators
`ObjectService` serves individual objects and sparse trees. Blame, path history, and ancestry run on the server and are memoized per commit; code search runs there without an index. Clients can list or watch the ordered log of accepted reference updates. Conflicts can go to a deterministic tool or an external model, or be returned to the agent. A model proposal lands automatically only if `verify.command` passes on the exact candidate tree; otherwise the agent receives the conflict package with the proposal. For deterministic rules, exact-tree verification is optional. Separately, `graft-verify` tests the landed tip, bisects failures, and can revert the culprit.

In two runs on one 16-core machine using the v0.3.0 tree, 50 agents submitted 250 changes to one branch with 20% intentional conflicts. Against the same server with batching disabled, batching without a resolver landed 200 changes versus 100–106, at 1,487–1,944 versus 264–385 lands/min, with p99 latency of 1.9–2.7 s versus 4.4–5.2 s. The demo's deterministic resolver landed all 250 changes in that workload. This is a comparison of landing strategies on one server, not a hosting-provider comparison or a v0.4.2 performance measurement.

### Trade-offs & Limitations
Compared with conventional clone-and-push Git hosting, gitai moves repeated reads and contention handling to the server. That fits short-lived workers sharing hot branches; it offers less to teams that depend on offline work or rarely contend on writes. CAS batching handles contention, but it does not make conflicting edits safe to merge. Index-free search avoids operating an index, but shifts search work to query time. Most upstream Gitaly RPCs keep working, though authoritative mode refuses some mutators, so existing write integrations need regression tests before a migration.

A horizontally scaled deployment means operating PostgreSQL, object storage, and rebuildable repository caches together. Multi-node tests share one physical machine; separate-host behavior has not been tested. File and in-memory buckets are exercised, but S3, GCS, and Azure are untested. Pack garbage collection is off by default, so operators need a retention and reclamation plan. The code is MIT-licensed, but pre-1.0 interfaces can still change. The practical adoption question is whether measured improvements on busy branches justify taking ownership of the storage and recovery path.

### Hardware & Deployment Guide
The source build targets Linux or macOS and requires Go 1.26, a C toolchain, Meson, and Ninja to compile bundled Git. `make build` puts the server, CLI, and tools in `_build/bin`. `examples/graft/quickstart.sh` runs a temporary server, cache daemon, and two-agent landing demo. For self-hosting, adapt `examples/graft/config.toml` and run `_build/bin/gitaly serve config.toml`. Bring the storage core up in `[graft.storage]` `shadow` mode, import the repositories, then switch to `authoritative` after checking existing write paths. The server itself needs no model API.

v0.4.0 added `graft repo create` and SDK repository creation, and blocked agents from writing server-owned references. v0.4.1 brought access-policy reloads: validate with `graft policy check` before reloading via SIGUSR1. v0.4.2 fixes storage-core correctness issues, including a case where a rejected push update could be recorded in the database, and moves bundled Git to v2.56.0. For a rollout, start with a single-node SQLite and file-backed pilot; validate PostgreSQL, the chosen bucket, and recovery on the intended topology before treating a multi-host deployment as ready.
```

## Key Capabilities
```text
- Workspace I/O: gRPC object and sparse-tree retrieval, selective materialization through `graft clone` and `graft sparse`, and an optional `graft-cache` daemon.
- Branch contention: `UserLand` rebases onto the current tip and batches concurrent lands into a single compare-and-swap reference update.
- Storage split: SQLite or PostgreSQL holds reference and changeset state, content-addressed packs live in object storage, and local Git repositories are rebuildable caches when the storage core owns repository state.
- Conflict policy: A versioned resolver protocol supports deterministic tools or external models; a model proposal must pass `verify.command` on the exact tree before automatic landing.
- Audit and recovery: An ordered, watchable changeset log records accepted reference updates and their actors; `graft-verify` can test the tip, bisect a failure, and revert the culprit.
- Benchmark scope: On one 16-core host, a v0.3.0-tree test landed 200 of 250 changes without a resolver versus 100–106 with batching disabled; 50 conflicts were planted deliberately.
```

## Quick Start / Clone
```bash
git clone https://github.com/feder-cr/git-ai.git
cd git-ai
make build                         # server, CLI and tools into _build/bin
examples/graft/quickstart.sh       # a server, a cache daemon, two agents and a land, in a temporary directory
./_build/bin/graft                 # the CLI and its commands
```
