Skip to content

Systems · Version control

MiniGit

A small Git written from scratch in Java 17, with real object storage, diffs and three-way merges.

MiniGit, sketched

Context

The problem

The best way I know to really understand Git is to build it: storing files, comparing versions and merging changes, without any libraries.

Approach

How I built it

  1. Stores files, folders and commits by their SHA-1 hash, the same way Git does.

  2. Uses the Myers diff algorithm and three-way merges, and adds conflict markers when two changes clash.

  3. Comes with a small built-in web server and dashboard, plus a static version that runs on Vercel.

Result

What came out of it

  • No outside libraries

  • Real diff and merge algorithms

  • A live dashboard