
pgit: What If Your Git History Was a SQL Database?
Originally published on oseifert.ch TL;DR: Built a Git-like CLI backed by PostgreSQL with automatic delta compression. Import any git repo, query its entire history with SQL. Benchmarked on 20 real repositories (273,703 commits): pgit outcompresses git gc --aggressive on 12 out of 20 repositories, while giving you full SQL access to every commit, file version, and change pattern. Then I gave an AI agent a single prompt and it produced a full codebase health report on Neon's own repo in under 10 minutes. What is pgit? pgit is a Git-like version control CLI where everything lives in PostgreSQL instead of the filesystem. You get the familiar workflow (init, add, commit, push, pull, diff, blame), but your repository is a database. And that means your entire commit history is queryable. pgit init pgit import /path/to/your/repo --branch main pgit analyze coupling file_a file_b commits_together ──────────────────────── ──────────────────────── ──────────────── src/parser.rs src/lexer.rs 127 s
Continue reading on Dev.to
Opens in a new tab




