What is pgit?
mainpgit is a Git-like version control CLI that stores repository data in PostgreSQL instead of on the filesystem. It allows you to import a Git repository and then use SQL, pre-built analyses, or cross-history search to interrogate the codebase's history.
Key capabilities include:
- Importing Git repos: Pull full history (merges, renames, author dates) into Postgres.
- Pre-built analyses: Run commands for
churn,coupling,hotspots,authors,activity, andbus-factorwithout writing SQL. - Raw SQL access: Query the underlying tables directly for custom analysis.
- Cross-history search: Perform grep-like searches across every version of every file in the history, not just the current checkout.
Note on Workflow: pgit is designed for repository analysis rather than daily development. While it supports standard Git commands like init, add, commit, log, diff, checkout, and blame, the imported history is append-only and immutable. The primary workflow is import followed by analyze, sql, or search.