Uses Git worktrees to create isolated working directories attached to the same repository, each on a different branch, so parallel experiments or long-running tasks do not interfere with the main working tree or require repeated stash-and-reapply cycles. This is especially useful when one branch requires a heavy build or test run while work continues on another.
Use cases
- Working on a feature branch that requires a 20-minute build while simultaneously starting work on a new feature branch
- Running CI-heavy tests on one branch while reviewing or merging code on another branch in the same repo
- Comparing the behavior of two branches side-by-side without switching contexts and losing uncommitted work
- Rebasing or interactive editing a long-running branch while keeping the main branch clean and deployable
- Reviewing a colleague's branch locally without disturbing your own uncommitted work
Key features
- Create a dedicated worktree for each branch using git worktree add, specifying a unique directory path outside the main repo folder
- Do heavy edits, builds, or test runs in the isolated worktree without affecting the main working tree
- Periodically rebase the worktree branch onto the main branch to catch integration conflicts early rather than at merge time
- When the worktree branch is merged, delete the worktree and prune the branch reference to keep the repository clean
- Use git worktree list to track all active worktrees and their associated branches
When to Use This Skill
- When a branch requires a long build or test run that would block other work
- When needing to work on two branches simultaneously without stashing uncommitted changes
- When reviewing or testing a colleague's branch locally while preserving your current working state
Expected Output
Isolated worktree directories, each on a named branch, with a clean lifecycle from creation to deletion after merge.
Frequently Asked Questions
- What are the limits of how many worktrees I can create?
- Git worktrees share the same object database, so disk usage is minimal, but each worktree must be on a unique branch. You cannot create a worktree for a branch that already has an existing worktree or the main checkout.
- Can I push to remote from a worktree?
- Yes, git push from a worktree behaves normally. The remote sees the branch normally regardless of which worktree it is pushed from.
- What happens to my worktree if I force-push or delete the branch it is on?
- The worktree directory remains but the branch reference becomes orphaned. You will see a warning when entering the directory. Either recreate the branch or delete the orphaned worktree with git worktree prune.
Related
Related
3 Indexed items
Finishing a development branch
Systematically closes out a development branch by running verification, cleaning up the commit history, pushing with proper tracking, and making an explicit choice between merge, squash, or follow-up tickets. This prevents the common pattern of abandoned branches, stale PRs, and lost context when work is not deliberately concluded.
SEO audit for web properties
Diagnoses indexing, crawlability, and on-page SEO issues across an entire site using automated crawls, Lighthouse checks, and structured output. An SEO audit surfaces actionable findings ranked by priority before manual review, making it possible to address critical issues quickly rather than discovering them through traffic drops.
Agentic AI orchestration efficiency claims due diligence
Turns CEO and vendor narratives about agentic AI efficiency into a procurement and strategy checklist. The workflow separates quoted efficiency metrics (for example token- or energy-per-user framing) from product launch facts, orchestration architecture claims, and third-party valuation context in the same article. It references CNBC reporting on June 3, 2026 that Perplexity CEO Aravind Srinivas told CNBC's Elaine Yu the long-term AI winner will maximize what he called the "most taken value per watt per user" by balancing accuracy, latency, cost, privacy, and intelligence; that Perplexity is emphasizing agentic orchestration with Perplexity Computer (announced February) and Personal Computer on Windows (announced the prior Tuesday, with Mac already available); that Srinivas said Personal Computer routes processing between device and cloud; that Perplexity was last reportedly valued at $20 billion versus Anthropic near $1 trillion and OpenAI just over $850 billion with Anthropic confidentially filing for a U.S. IPO that week; and that Srinivas cited tripled annualized revenue since the start of the year tied to integrated Anthropic model improvements—without treating media valuations or CEO efficiency slogans as internal benchmarks.