惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
量子位
T
Tailwind CSS Blog
Vercel News
Vercel News
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
Engineering at Meta
Engineering at Meta
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
D
Docker
博客园_首页
P
Proofpoint News Feed
月光博客
月光博客
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Martin Fowler
Martin Fowler
腾讯CDC
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal).
GitHub - willhackett/wtdb: Copy databases and update envi...
whh · 2026-06-15 · via Show HN

Give every git worktree its own database.

The problem

You use git worktree to work on several branches at once. But every worktree points at the same local dev database. The moment one branch runs a migration, it changes the schema the others rely on — so concurrent branches with diverging migrations step on each other.

A fresh worktree is also missing everything git ignores: your .env / .dev.vars, your node_modules. So it isn't even runnable until you copy things across by hand.

What wtdb does

When you create a worktree, wtdb automatically:

  1. Copies your dev database into a new one named after the worktree (Postgres, via a near-instant CREATE DATABASE ... TEMPLATE).
  2. Copies your env file into the worktree and rewrites the database URL to point at the new database.
  3. Copies the paths you list (e.g. node_modules) using fast copy-on-write clones.

Install

curl -fsSL https://raw.githubusercontent.com/willhackett/wtdb/main/install.sh | sh

(Homebrew coming later, maybe.)

Enable it in a repo

Add a .wtdb.json to the repo root:

{
  "envFile": ".dev.vars",
  "dbEnvVar": "DATABASE_URL",
  "pathsToCopy": ["node_modules"]
}
  • envFile — the env file to copy and rewrite (.env, .dev.vars, …).
  • dbEnvVar — the variable in that file holding your postgres://… connection URL.
  • pathsToCopy — gitignored dirs/files to bring into each new worktree.

Then install the git hook (once per repo):

wtdb init      # writes a starter .wtdb.json if you don't have one
wtdb install   # installs the post-checkout git hook

Usage

Just use git as normal:

git worktree add ../myapp-feature
# -> wtdb copies the db, writes the env file, clones node_modules

When you remove a worktree, reclaim its database:

git worktree remove ../myapp-feature
wtdb prune     # drops databases whose worktrees are gone

Other commands:

wtdb sync      # provision the current worktree manually
wtdb status    # list worktrees and their databases

Adapters

wtdb ships with a PostgreSQL adapter. The database layer is an interface (internal/db), so support for other databases can be added by implementing Copy / Drop for a connection-URL scheme and registering it. PRs welcome.

License

MIT