Skip to main content
wit is a Git-compatible version control system written in TypeScript, with an integrated hosting platform.

Key Components

DirectoryPurpose
src/commands/CLI command handlers
src/core/Git internals: objects, refs, index, merge, diff
src/core/protocol/Smart HTTP, packfile read/write
src/server/Hono server, Git HTTP endpoints
src/api/trpc/tRPC routers for the platform API
src/db/Drizzle schema and data models
src/ai/AI agent and tools
src/ui/Terminal UI, web UI, graph rendering

How Git Storage Works

wit stores data the same way Git does:
  • Objects (blobs, trees, commits, tags) are content-addressed by SHA-1 hash
  • Refs (branches, tags) are files containing commit hashes
  • Index tracks staged files for the next commit
  • Packfiles bundle objects for network transfer
All objects live in .wit/objects/, refs in .wit/refs/.

Network Protocol

wit implements Git Smart HTTP for clone/fetch/push:
  1. Client discovers refs via GET /info/refs
  2. Client/server exchange packfiles via POST /git-upload-pack or /git-receive-pack

Platform

The hosting platform adds:
  • PostgreSQL for users, orgs, repos, PRs, issues
  • tRPC API for the web app and CLI commands like wit pr
  • React web app for browsing repos and managing PRs

Detailed Documentation

For comprehensive architecture documentation, see: