tobi /walgit

★ 2,706⑂ 180👁 18▤ 0
RustCreated 2026-08-24
2,706
stars
+0+3+92
180
forks
18
watchers
–
prs
–
issues
0
releases
–
discussions

README

walgit — a git server that is one binary in front of an object store

walgit hosts git repositories with no database, no leader and no local state that matters. You run a
single binary, point it at an S3 or GCS bucket, and you have: smart HTTP (v0/v2) fetch and push, Git LFS, a browsing web UI, a JSON API with an SDK, per-repository push policy,
webhooks — and a server that scales to repositories larger than the machine it runs on. Every machine that
runs walgit is a disposable cache; the bucket is the repository.

sh
 1. a bucket (any S3-compatible store or GCS) and a config
cat  walgit.toml / namespaces, sha1 and sha256 repositories. Upstream git does upload-pack/repack; walgit does receive-pack, the WAL and the plumbing. |
| LFS | Batch API + basic transfer, objects in the bucket, optional read-through from an upstream LFS server for imported repositories. |
| web UI + API | A React UI (tree, blob, commits, diffs, the WAL's own health page) on a read-mostly JSON API under /{owner}/{repo}/api/; sha-addressed answers are immutable and cached everywhere; long answers stream progress as SSE. repos.js is a dependency-free SDK for pages, agents and scripts. |
| policy | Per-repository push rules (policy.json): protected refs, groups, fast-forward only, bypass lists. docs/POLICY.md. |
| settings | Per-repository config (maintenance, compaction, upstream follow) published into the WAL with history. |
| events | A small bridge tails the WAL and POSTs ref events to a webhook, exactly-once per (repo, seq, ref) with a durable cursor. docs/EVENTS.md. |
| maintenance | Checkpoints, geometric compaction, connectivity audits and repairs — one loop that computes the desired state from (config, WAL) every pass and does one bounded unit of the most important missing work. Manual compact --base rebuilds the base on a host with sufficient disk. |
| auth | none (loopback), token (static tokens), oidc (any OpenID Connect issuer: browser sign-in, ID tokens, and walgit-issued access tokens for git). /services/public/install.sh sets a developer's machine up in one idempotent command. |
| stores | S3 and S3-compatible (AWS, MinIO, rustfs, R2, Ceph, …) and GCS, first class; an in-memory store for tests. |

 How it works, briefly

The repository is a WAL in the bucket. Under repos///: manifest.pb (tiny, CAS-rewritten:
head sequence, the live pack set, checkpoint pointer, settings — the linearization point), log/.pb
(immutable entries: PUSH, COMPACT, CHECKPOINT, SETTINGS), wal/.pack|.idx|.rev|.bitmap|.commit-graph
(immutable, content-addressed packs with their side-files), checkpoints// (folded ref snapshot + pack
inventory so a cold start is snapshot + tail), leases/ (CAS with TTL — the only cross-instance
mutex), policy.json, lfs/objects/, events/cursor.json.

A push: our receive-pack indexes the pack (git index-pack --fix-thin --rev-index in a scratch dir), checks
connectivity and policy, uploads pack ∥ idx ∥ log entry, then CASes the manifest. On a 412 it re-reads,
re-

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON