I use git worktrees daily. I'm surprised by how hard it can be to explain them to people who have never used them. Lately I've settled on "like clones, but sharing a .git directory."
To solve some of the ergonomics issues (command verbosity, manual commands to copy over .env files and install dependencies), I wrote autowt, which is a lightweight but powerful worktree manager: https://steveasleep.com/autowt/
The one real caveat to this is that if your application has particularly heavy cold starts it can be hard to actually run your worktrees. I usually end up swapping to a regular checkout as each worktree is due for hands-on attention.
It makes coordination easier. For eg if you want to fetch and pull master, you only have to do that once. If you want to rebase checkout A's branch on top of B's, you can just do that, you don't have to push between the two and have superfluous tracking branches.
I use git worktrees daily. I'm surprised by how hard it can be to explain them to people who have never used them. Lately I've settled on "like clones, but sharing a .git directory."
To solve some of the ergonomics issues (command verbosity, manual commands to copy over .env files and install dependencies), I wrote autowt, which is a lightweight but powerful worktree manager: https://steveasleep.com/autowt/
Fossil SCM, conventionally, has been thus way by default.
https://fossil-scm.org/home/doc/trunk/www/gitusers.md
wt is a useful little tool for helping with git worktrees: https://github.com/timvw/wt
I use it's config to copy in some non-repo config and then hooks to start an agent doing analysis.
The one real caveat to this is that if your application has particularly heavy cold starts it can be hard to actually run your worktrees. I usually end up swapping to a regular checkout as each worktree is due for hands-on attention.
I'm curious what the constraint preventing you from optimizing the cold start time - can you share more?
This is very interesting and could be very helpful for A/B testing or comparing outputs/speed between 2 branches.
I already know a place I want to use this.
I do the same thing just checking out the repo multiple times in different directories.
I'm not really sure what worktrees adds on top of that.
It makes coordination easier. For eg if you want to fetch and pull master, you only have to do that once. If you want to rebase checkout A's branch on top of B's, you can just do that, you don't have to push between the two and have superfluous tracking branches.
Less space.
What a peculiar title. The title suggest parallel dev without using worktrees, but the article is about using worktrees.
I thought that as well and then realized I had inserted the word "of" before "using" where there's an implied "by."