Gitloom — Rebuilding Git, Mostly to See What Breaks

October 30, 2025 | 10:34 AM

What happens if you strip Git down to its essentials and rebuild it just to see how it works? Gitloom is a tiny version control system written out of curiosity, focused on learning Git’s internals by implementing them one piece at a time.

Go

Gitloom is a tiny, intentionally limited version control system written in Go. It exists for one reason: curiosity. I wanted to understand what Git actually does behind the scenes, and the fastest way to do that seemed to be rebuilding a very small, very incomplete version of it.

Example workflow of gitloom

This is not an attempt to compete with Git. Git has had years of careful design, battle testing, and contributors far smarter than me. Gitloom, on the other hand, has me, a text editor, and a willingness to break things in the name of learning.

Why Build This at All?

Git is one of those tools that feels obvious after you understand it—but opaque right up until that point. I found myself using commands fluently while only vaguely understanding what they translated to internally.

So instead of reading more blog posts about Git internals, I decided to build something that would force the answers out of me:

  • What actually happens during git init?
  • How are files stored, hashed, and retrieved?
  • What do blobs, trees, and commits look like when they’re not diagrams in a blog post?

Gitloom is the result of that exploration—part experiment, part learning aid, part “let’s see if this works.”

What Gitloom Currently Does?

Gitloom supports a small set of Git-like commands. Each one exists because I wanted to understand that specific piece of Git.

1. Initializing a Repository

gitloom init

This sets up a minimal repository structure:

  • .gitloom/
  • .gitloom/objects/
  • .gitloom/refs/
  • .gitloom/HEAD

Checkout out the demo.

2. Turning Files into Objects

gitloom hash-object <file>

This command:

  • Converts a file into a blob
  • Prepends the familiar blob <size>\0 header
  • Computes a SHA-1 hash
  • Compresses and stores the object in: .gitloom/objects/<hash_prefix>/<hash_suffix>

I've written more on the types of objects in Git, read here.

3. Inspecting Objects

gitloom cat-file -[p|s|t] <hash>

This lets you:

  • View the object contents
  • Check its size
  • Identify its type

It reads objects using buffered I/O and behaves very similarly to Git’s own cat-file, minus decades of polish and edge-case handling. Checkout out it action.

4. Writing Trees from Directories

gitloom write-tree

This walks the directory recursively, hashes files and subtrees, and writes a tree object representing the current state.

Footnote

Gitloom made me appreciate Git not as a mysterious tool, but as a collection of simple ideas assembled with incredible care. Rebuilding even a small subset of it makes you realize how much thought lives under everyday commands.

I’ll keep extending it as long as curiosity keeps pulling me forward. If nothing else, it has already done its job: Git no longer feels like magic—just very good engineering.

You can explore the project on GitHub or follow updates as they happen on X(twitter).