Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pgit

> 编程语言
Open source

Git-like version control CLI backed by PostgreSQL with pg-xpatch delta compression

198 stars0 likes1 views
WebsiteGitHub

About

Git-like version control CLI backed by PostgreSQL with pg-xpatch delta compression

pgit

A Git-like version control CLI backed by PostgreSQL with pg-xpatch delta compression.

Note: pgit is primarily a demo for pg-xpatch delta compression. It's not intended to replace git—but it is genuinely useful for importing a repo and running SQL analytics on your commit history.

Why pgit?

Import any git repo. Analyze it instantly.

bash
pgit init
pgit import /path/to/your/repo --branch main
pgit analyze coupling

No scripts, no parsing git log output. Just answers.

file_a                    file_b                    commits_together
────────────────────────  ────────────────────────  ────────────────
src/parser.rs             src/lexer.rs              127
src/db/schema.go          src/db/migrations.go      84
README.md                 CHANGELOG.md              63

Need something custom? Everything is in PostgreSQL — write your own SQL:

…

bash

Build the benchmark tool

go build -o pgit-bench ./cmd/pgit-bench/

Run against the curated repo list (20 repos, ~8 min at --parallel 3)

./pgit-bench --file bench_repos.txt --parallel 3 --report BENCHMARK.md


The repo list in [`bench_repos.txt`](bench_repos.txt) covers 20 projects across 6 languages (Rust, Go, Python, JavaScript, TypeScript, C) — from small utilities like jq (1.9k commits) to large projects like git (80k commits).

You can also benchmark individual repos:

```bash
./pgit-bench https://github.com/tokio-rs/tokio

…

bash
bash
# Start a pg-xpatch container (creates database 'myproject' automatically)
docker run -d --name pgit-remote \
  -e POSTGRES_USER=pgit \
  -e POSTGRES_PASSWORD=pgit \
  -e POSTGRES_DB=myproject \
  -p 5433:5432 \
  ghcr.io/imgajeed76/pg-xpatch:latest

# Add it as a remote and push
pgit remote add origin postgres://pgit:pgit@localhost:5433/myproject
pgit push origin

The database name can be anything you want - just make sure it matches in both the container and the connection URL. pgit will initialize the schema automatically on first push.

Shell Completions

bash
# Bash
pgit completion bash > /etc/bash_completion.d/pgit

# Zsh
pgit completion zsh > "${fpath[1]}/_pgit"

# Fish
pgit completion fish > ~/.config/fish/completions/pgit.fish

Environment Variables

Variable Description
PGIT_CONTAINER_RUNTIME Force docker or podman
PGIT_ACCESSIBLE Set to 1 for accessibility mode (no animations)
NO_COLOR Disable colored output

License

MIT


Built with ❤️ by Oliver Seifert

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言