March 18, 2026
DB Hunger Games: Git Edition
Show HN: Pgit – A Git-like CLI backed by PostgreSQL
Git-in-Postgres drops, and the comments ignite a DB cage match
TLDR: A new tool puts Git history inside a Postgres database so you can ask questions with simple SQL and claims strong compression wins. The community loved the AI + SQL angle but brawled over the database choice, debating Postgres vs SQLite vs DuckDB while dreaming up multi-repo search and instant code health reports.
A developer just smashed code history into a database with pgit, a command-line tool that stores Git repos in PostgreSQL and lets you ask questions with plain SQL. It even claims to compress code changes better than Git’s own cleanup on 12 out of 20 real projects, and says an AI agent cranked out a code health report in under 10 minutes. That’s the headline — but the comments? That’s where it got loud.
The crowd split fast into teams. One camp cheered the AI angle — “let agents write SQL and go wild” — imagining dashboards and instant reports. Another camp started chanting database names like it’s the tech Olympics: Postgres loyalists vs SQLite minimalists vs DuckDB data nerds vs a nostalgia shout-out to Fossil (the version control system built for SQLite). A pragmatic voice argued that write speed isn’t a big deal for many teams — you import once and mostly read — so a simpler SQLite setup could win; others countered that Postgres unlocks serious querying and scale. Then a curveball: someone asked if this could power multi-repo, full-text searches across your entire code universe.
Memes flew (“DB Thunderdome!”), and the vibe was part excitement, part “why not use DuckDB?” The only thing everyone agreed on: querying code history like a spreadsheet sounds powerful. Whether it lives in Postgres, SQLite, or something else — the community wants the superpower, not the plumbing.
Key Points
- •pgit is a Git-like CLI that stores repositories in PostgreSQL, making full commit history queryable with SQL.
- •Built-in analyses include churn, coupling, hotspots, authors, activity, and bus-factor with JSON, raw, and interactive outputs.
- •pgit uses pg-xpatch, a PostgreSQL Table Access Method based on the xpatch delta compression library, to store deltas and reconstruct content on SELECT.
- •In benchmarks across 20 repositories (273,703 commits), pgit outcompressed git gc --aggressive in 12 of 20 cases.
- •An AI agent generated a codebase health report on Neon's repository in under 10 minutes using pgit’s SQL-accessible data.