2 years ago
Sun Jul 16, 2023 11:24am PST
(How) do you use Git worktrees?
Reading online I've seen a couple ways that people use git worktrees. One is to create one worktree per branch, where the worktree path is based on the branch name. Another is to have a limited set of worktrees that are re-used (not sure how much of that comes down to personal preference vs it being expensive for those with huge repos to spin up new worktrees on the fly).

There is also the matter of where to put the worktrees. Some people have a `.worktrees` directory within their repo which is either ignored/excluded by git, and some people opt to store worktrees in outside the repo. Some people create a bare repo so that there's no distinction between main and linked worktrees, though it's not clear to me what the pros/cons of that are.

So, how do _you_ use worktrees in your daily life?

comments:
add comment
loading comments...