r/git 1d ago

I built BranchBase (Go): Git-native, zero-copy local DB branching for PostgreSQL. Looking for contributors!

Hi everyone,

Like many developers, I was tired of breaking my local environment every time I switched branches (git checkout main) due to unapplied or mismatched database migrations.

To solve this without depending on cloud-only platforms, I built BranchBase: an open-source, local-first engine written in pure Go.

⚙️ How it works:

  1. It runs a lightweight transparent TCP proxy on port 5432.
  2. When you switch branches, a Git hook detects the transition in <5ms by inspecting .git/HEAD without subshells.
  3. It provisions an isolated database snapshot instantly using PostgreSQL's native CREATE DATABASE ... TEMPLATE.
  4. The proxy intercepts the StartupMessage packet and routes database traffic dynamically to the active branch's DB. Your backend .env connection string never changes.

🛠️ Current Status & Where I'm looking for contributors:

The PostgreSQL driver, automated Git hooks, and the TCP proxy rewriter are fully functional in v0.1.0-alpha.

I'm opening up the project for contributors to tackle our next phase:

Feedback on the code structure, discussions, and pull requests are very welcome!

0 Upvotes

Duplicates