TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

(How) do you use Git worktrees?

2 pointsby jesseduffieldalmost 2 years ago
Reading online I&#x27;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).<p>There is also the matter of where to put the worktrees. Some people have a `.worktrees` directory within their repo which is either ignored&#x2F;excluded by git, and some people opt to store worktrees in outside the repo. Some people create a bare repo so that there&#x27;s no distinction between main and linked worktrees, though it&#x27;s not clear to me what the pros&#x2F;cons of that are.<p>So, how do _you_ use worktrees in your daily life?

no comments

no comments