Skip to content
🤖 This documentation is AI-generated. Spotted a mistake? Let us know on GitHub.
branchly logo

Give every Git branch its own database

Switch branches, and your data follows. branchly provisions, migrates, and seeds a database per branch — automatically, on checkout.

Automatic on checkout

A Git hook provisions the right database the moment you switch branches. First visit: create → migrate → seed. Every visit after that: instant.

Your stack, not ours

Plugin-based on every axis: PostgreSQL, MySQL, and SQLite datasources; Prisma, Drizzle, and Knex migrators; env file and direnv resolvers — and room for yours.

Fast via snapshots

Fully migrated-and-seeded golden images are cached by migration fingerprint, so new branches clone in well under a second instead of paying a full migrate + seed.

Safe by design

branchly only ever touches databases it created, never drops protected branches, and confirms before anything destructive. Your data stays yours.

Terminal window
npm install --save-dev branchly
npx branchly init

init detects your stack, installs the adapters it needs, writes a config, and wires up the Git hook. From then on, switching branches just works:

Terminal window
git checkout -b feature/login # branchly provisions a fresh database
git checkout main # …and instantly switches back to main's

Curious how it all fits together? Start with why branchly exists, or jump straight to the quickstart.