Reuse build directories across Git worktrees on macOS/Linux to speed up builds and save disk space. - theblixguy/warm-worktrees
Basically I kept running out of space on my 512 GB Mac. I switch worktrees a lot when I'm reviewing or testing changes so I'd end up with a separate build folder for each one and spend a few minutes rebuilding the same deps.
So I made Warm to let my worktrees share a build cache. It uses a filesystem feature called block cloning so the copies of your build caches share disk space until files change (and only those changed files occupy extra space). It's also really useful when I am working with coding agents e.g. to try two approaches in parallel each in its own worktree.
In my work project I was able to cut builds from taking 5 mins to 1 min and use over 50% less disk space.
Now if you're using a different build system like Bazel or etc you probably don't need this tool as they already offer a shared cache feature, but I didn't want to change build systems nor want to make others do it.
This is also a general-purpose, cross-platform (macOS and Linux) tool so you can use it with other languages and systems like Rust, TypeScript and etc so it's a single tool across all your various projects. It's quite customisable as well and can be easily integrated into your workflows, especially if you're using AI agents.
If you have any thoughts or feedback or if this tool helps you please let me know, thanks!
0 comments
No comments yet.
Related stories
- The Verge · 0 points · about 8 hours ago
- Hacker News · 1 points · 1 day ago
- Hacker News · 3 points · 2 months ago
- Hacker News · 3 points · 2 months ago
- Hacker News · 15 points · 3 months ago
- Hacker News · 2 points · 4 days ago