Theo-brainUnofficial. Not affiliated with Theo or t3.gg.
Sign inYou

T3 Code guide

Submodules and sparse checkout for worktrees

Source control and worktrees

A worktree is a separate copy of your project's files so agents can work without clashing.

New worktrees initialize submodules recursively and check out every file by default. A Submodules setting and a t3.json sparse pattern file can limit this for large repositories.

T3 Code docs: project settings

What it’s for

Speeding up worktree creation in large repositories or repositories with many nested submodules.

T3 Code docs: project settings

When to use it

When creating a worktree is slow because of submodules or repository size.

T3 Code docs: project settings

How to use it

  1. In Settings → Worktrees under Advanced, set Submodules to Top level only or Skip. Select a project first to override it for that project.

    T3 Code docs: project settings

  2. For sparse checkout, set worktreeSparsePatternsPath in t3.json to a repository file of non-cone sparse-checkout patterns.

    T3 Code docs: project settings

  3. Make sure the pattern file exists on the branch being checked out. If it is missing, worktree creation fails. Sparse checkout needs Git 2.35 or newer.

    T3 Code docs: project settings

What’s changed

  • Your t3.json can now name sparse-checkout patterns for new worktrees.Updated Nov 20
  • t3.json can name sparse-checkout patterns for new worktrees.Updated Nov 17

Related settings

Unofficial notes. Not affiliated with Theo or t3.gg.