I run 2 "developers" and myself. Also with tmux, in 3 windows, but I just clone the repo for the 2 developers and then manually pull into my copy when I think it's done. I see various people/sites mentioning git worktrees. I know what it is, but how is it better?
git worktrees optimize how data is shared across multiple directories. So, you’re not cloning and duplicating a bunch of code on your machine and just referencing data from the original .git folder.
The only downsides I’ve seen:
1. For JS projects at least, you still need to npm install or yarn install for all packages. This can take a bit of time.
2. Potentially breaks if you have bespoke monorepo tooling that your infra team won’t accept updates for, why is this example so specific, I don’t know just accept my PR please. But I digress.
Can I say it's just for disk (and perhaps speed when pulling/pushing) optimisation? But as long as that's not a bottleneck, there is no difference?
(because git clone is much cleaner and feels less risky especially with agents)
> 1. For JS projects at least, you still need to npm install or yarn install for all packages. This can take a bit of time.
I believe that's the problem pnpm is trying to solve (err, not the time part, I can't swear it's wall clock faster, but the "hey hard links are a thing" part <https://pnpm.io/faq#:~:text=pnpm%20creates%20hard%20links%20...> )