dgit is a Git server and forge for Cloudflare Workers and self-hosted machines using Durable Objects. Each repository is a Durable Object with a private SQLite database that stores repository objects and references, implements Git's smart HTTP protocol for standard Git clients, and provides a cgit-style web interface. Reads are public by default, while pushes require authentication; pushing to a new name creates the repository.
The TypeScript implementation includes Git packet-line framing, pack-file parsing and generation, ofs- and ref-delta resolution, commit/tree/tag codecs, SHA-1 streaming, and Myers diffs. Pushed data is retained as the client's original compressed pack file, with an index mapping object IDs to packs, offsets, and delta bases. An optional Cloudflare R2 binding offloads pack bytes and caches full clones, while SQLite retains the index; clones copy stored compressed bytes into outgoing packs, and fetch negotiation supports shallow, incremental, thin-pack, forced-update, and ref-deletion operations.
Its web interface includes repository summaries, refs, searchable logs, per-path history, trees, blobs with syntax highlighting, blame, commits and range diffs, format-patch output, archive snapshots, README-based about pages, Atom feeds, and commit-activity statistics. Deployment uses npm and Wrangler, with an optional R2 pack cache and a configured push token. Cloudflare Workers impose memory and CPU limits, so very large histories may require smaller pushes; repositories with millions of objects may be better suited to the project's celld deployment.