Comment by ed_mercer

Comment by ed_mercer a day ago

5 replies

I don't understand how people use the `git worktree` workflow. I get that you want to isolate your work, but how do you deal with dev servers, port conflicts and npm installs? When I tried it, it was way more hassle than it was worth.

maddmann a day ago

Yeah it is a mystery to me how folks could also maintain context in more than two sessions. The code review would be brutal.

You’ll also end up dealing with merge conflicts if you haven’t carefully split the work or modularized the code.

larusso a day ago

I generally like to use it. But I one project in the org which simply can’t work because the internal built system expects a normal .git directory at the root. Means I have to rewrite some of the build code that isn’t aware of this git feature. And yes we use a library to read from git but not the git cli or a more recent compatible one that understands that the current work tree is not the main one.

fabbbbb a day ago

Agree, depending on the repo and changes it’s hard with local dev servers. It sometimes works well if you don’t need local dockers and want to outsource git workflow to CC as well. Then it can do on that branch whatever it wants and main work is in another worktree with more steering and or docker env.

ryandetzel a day ago

I have a bash script that creates the worktree, copies env over and changes the ports of containers and the services. I then can proxy the "real" port to any worktree, it's common I'll have 3 worktrees active to switch back and forth

danmaz74 a day ago

I gave that a try, then I decided to use devcontainers instead, and I find that better, for the reasons you mentioned.