Skip to content
Back to the catalog
Project gitToolingAdvancedBeta

Build your own Git

Blobs, trees and commits. Discover that Git is a content-addressed object store, and little else.

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

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.

    1. 01Initialize the repository
    2. 02Write blobs
    3. 03Read objects
  2. Phase 23 stages

    Trees

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

    1. 01Tree format
    2. 02Write the working tree
    3. 03Read trees
  3. Phase 34 stages

    Commits and history

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

    1. 01Create commits
    2. 02Refs and HEAD
    3. 03Commit command
    4. 04Walk history
  4. Phase 42 stages

    Going back

    Checking out a commit and rebuilding the working directory.

    1. 01Safe checkout
    2. 02Restore the worktree

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.

  • coding-agent
    Beta

    Build a Coding Agent

    Learn the core foundations of AI coding assistants from scratch: model basics, API key security, why use OpenRouter as a universal model router, tool schemas, and the autonomous ReAct loop.

    Beginner7 stages~6 hTooling
    agentopenrouterllm+3

    Python · TypeScript

  • grep
    Beta

    Build your own grep

    Read stdin, filter by pattern and honour exit codes. The gateway to Unix tooling.

    Beginner7 stages~6 hTooling
    regexclistdin

    Go · Python · Zig

  • bittorrent
    Beta

    A BitTorrent client

    Bencode, trackers and the peer-to-peer protocol. Download a real file by talking to real peers.

    Advanced12 stages~20 hNetworking
    bencodep2pprotocolos+1

    Go · Python · Java