Skip to content

[Feature]: Project-level config for symlinking large shared directories into worktrees #10451

Closed

Description

@brennanb2025

Follow-up to #7549 (shipped in #9791). Raised by @suiramdev in #7549 (comment).

Problem

#9791 added project-level .worktreeinclude, which copies listed gitignored paths into each new worktree. Copy is the right semantic for .env, .vscode/, and secrets: each worktree must own its file, and edits must not leak back to the primary checkout.

Copy is the wrong semantic for large, rebuildable, identical-across-worktrees directories — node_modules, .cache, build caches. There:

  • Duplicating hundreds of MB per worktree is slow and disk-hungry. On macOS/APFS this is cheap (clone-on-write), but on Linux and Windows it is a full byte-for-byte copy.
  • One install should ideally serve every worktree; per-worktree copies drift.

Orca already has the symlink machinery (repo.symlinkPaths / Worktree Shared Paths, createWorktreeLinkedPaths). The gap is the same one #7549 closed for copies: that list is per-user Orca config, so it is not version-controlled, not shared with teammates, and not portable across machines.

Proposed solution

A project-level, version-controlled way to declare directories that should be symlinked (shared) rather than copied into new worktrees — the counterpart to .worktreeinclude.

Open design questions:

  • Where the config lives — an .orca/ config file, orca.yaml, or a distinct include file. Worth checking what neighbouring tools already read so a repo can drop one file and have it work in several.
  • Merge behaviour with the existing per-user symlinkPaths (.worktreeinclude merges with, never replaces).
  • Collision rule when a path appears in both the copy list and the symlink list. Today the symlink pass runs first and the copy pass skips any path that already exists, so symlink wins — that precedence should be made explicit rather than incidental.
  • Safety — symlinking means worktree edits do reach the shared target. That is intended for node_modules, but the docs should be explicit, and the same traversal/.git guards as the copy path must apply.

Notes

Activity

  1. added a commit that references this issue on Jul 28, 2026
    6d4e335
  2. added a commit that references this issue on Jul 31, 2026
    f138986
  3. added 2 commits that reference this issue on Oct 15, 2026
    1d79e4f
    5625167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions