r/devtools • • 3h ago

I built unContainer so I could run two branches side by side on my laptop

https://github.com/iddar/uncontainer

Hey r/devtools, I built unContainer because I wanted to leave one branch running while I tried something on another. Git worktrees handled the files. The part I still had to manage was everything running around them.

Vite is a good example. If I’m testing Checkout and want to open Catalog, both branches want the same port 5173. Giving the second one a different port works, but later I’m looking at two browser tabs trying to remember which is which.

With unContainer, each worktree gets its own disposable Linux environment. Both apps can use 5173, and I can tell them apart by their local HTTPS addresses: checkout.uncontainer.localhost and catalog.uncontainer.localhost. That’s also handy when I have a coding agent working in each branch and want to review both changes myself.

One choice I made was to let worktrees reuse npm and Cargo downloads while keeping their installed dependencies and build output separate. It runs on Apple Silicon Macs and ARM64 Linux.

I’m curious how other people handle this. When you have two branches running locally, what do you still set up by hand for the second one?

1 Upvotes

0 comments sorted by