Skip to content
Work in isolated Git worktrees
On this page
DocumentationWorkspace

Work in isolated Git worktrees

A Git worktree is a separate checkout of a repository. Use one when a task needs its own branch and files while you keep working in another checkout.

Start isolated work

  1. Open a Git repository in Code.
  2. When creating a new Code session, choose the worktree option if offered and review the requested branch or starting state.
  3. Wait for setup to finish before sending editing instructions.
  4. Confirm the resulting folder and branch in the task and Git panel.
  5. Review and commit the task’s changes within that checkout before deciding how to integrate them.

Worktrees share repository history, but their working files and branch state are separate. They are not separate provider accounts or automatic copies of every uncommitted change. Verify the starting state instead of assuming a dirty primary checkout was carried across.

Configure defaults

Open Settings → Worktrees to set Worktree root, Branch prefix, and Always fetch upstream before creating worktrees. Fetching can require network access and Git credentials. Use Save settings after changing defaults.

The same page offers Automatically delete old worktrees and Auto-delete limit. Understand those settings before relying on a checkout as permanent storage. Native cleanup timing and dirty-worktree protection require additional walkthrough verification for this draft; keep important changes committed or otherwise backed up rather than inferring protection from a label.

Inspect existing checkouts

Open Command Center → Worktrees to distinguish the primary checkout, Rudr-managed worktrees, other linked worktrees, detached worktrees, and stale entries. A worktree created by another tool should not be treated as disposable just because Rudr can see it.

If setup fails, preserve both the original checkout and any created destination. Check the branch, path, Git availability, and displayed error. See Git and workspace recovery.

Instructions have been reviewed against the application source; native setup and account walkthroughs remain to be verified. Platform and provider limitations are described above.

Work in isolated Git worktrees — Rudr