Skip to content
Back to the catalog
Project gitToolingAdvancedComing soon

Build your own Git

Build your own Git from scratch. Store blobs, trees and commits to understand content-addressed objects and how version control works.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.

Git has a reputation for being complicated, but its data model fits on a whiteboard: four object types, a hash and a graph. Everything confusing lives in the interface, not underneath.

In this challenge you implement what's underneath. You'll create objects, write them compressed into .git/objects, build trees from the working directory, make commits and walk the history. Best of all: real Git will be able to read your repository.

Roadmap

12 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 13 stages

    The object store

    init, writing zlib-compressed blobs and reading them back by hash.

  2. Phase 23 stages

    Trees

    Represent directories, write the working tree and read it back.

  3. Phase 34 stages

    Commits and history

    Commits with parents, refs, HEAD, and a log that walks the graph.

  4. Phase 42 stages

    Going back

    Checking out a commit and rebuilding the working directory.

Before you start

A Git implementation that is compatible at the format level: init, hash-object, cat-file, write-tree, commit-tree, log and checkout. It writes zlib-compressed objects identified by SHA-1, and produces repositories that official git opens without complaining.

  • grep
    Coming soon

    Build your own grep

    Build your own grep from scratch. Read stdin, filter text by pattern and handle exit codes while learning the foundations of Unix tools.

    Beginner7 stages~6 hTooling
    regexCLIstdin

    Go · Python · Zig

  • coding-agent
    Coming soon

    Build your own coding agent

    Build a coding agent from scratch. Connect models through OpenRouter, secure API keys, define tools and implement the autonomous ReAct loop.

    Beginner7 stages~6 hTooling
    agentsOpenRouterLLM+3

    Python · TypeScript

  • hash-functions
    Beta

    Build SHA-256 and HMAC from scratch

    Build SHA-256 and HMAC from scratch. Implement rotations, padding and compression blocks, then sign and verify messages without a crypto library.

    Intermediate7 stages~8 hSecurity
    hashingcryptographybits

    C · Python · Go