Lobsters
Read post

Git in Postgres

An exploration of storing git repositories inside PostgreSQL instead of the filesystem. The author built gitgres, a ~2,000-line C library implementing libgit2's object and ref database backends against Postgres via libpq. The git data model maps to just two tables (objects and refs), enabling SQL queries that join commit history with application data like issue trackers. The post argues this approach could simplify self-hosted forge deployments (targeting Forgejo/Gitea) by eliminating the split between a Postgres-backed web app and filesystem-based bare repos, enabling unified backups with pg_dump, row-level security for multi-tenancy, and NOTIFY-based push events. Storage overhead from lack of delta compression is acknowledged as a real trade-off, but the author argues operational simplicity outweighs it for small instances.

    #forgejo#git#postgresql
Feb 26•8m read time•From nesbitt.io
Post cover image
Table of contents
ForgejoPostgresDiff, merge, blameStorage
390.7K Impressions3 Comments
Lobsters's image
Lobsters

Lobsters is a community-driven platform for sharing and discussing links to articles, tutorials, and...

1.9K Followers

•

36.1K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard