Files to copy
Configure gitignored files that Conductor copies into new workspaces
New git worktrees start with tracked files only. That keeps workspaces clean, but it also means untracked files such as .env.local, local service credentials, and machine-specific config do not appear in new Conductor workspaces.
Files to copy solves that problem by copying selected gitignored files from your main checkout into each new local workspace.
For setup steps, see Use Files to copy. For the underlying worktree model, see Git worktrees for coding agents.
Configure Files to copy
You can configure Files to copy in Conductor or in a settings file:
- In the app, open
Settings, select the project, and edit Files to copy. - In the repository, add
file_include_globsto.conductor/settings.tomlwhen the same patterns should be shared with teammates.
Use this repository configuration when every new workspace should receive the same gitignored files:
"$schema" = "https://conductor.build/schemas/settings.repo.schema.json"
file_include_globs = """
.env.local
config/local.json
certs/local/**
"""Commit .conductor/settings.toml when every teammate should copy the same gitignored local files into new workspaces. For settings file locations and precedence, see User and project settings.
You can also configure shared patterns with .worktreeinclude at the repository root:
.env.local
config/local.json
certs/local/**Use .worktreeinclude when your project already uses worktree tools that read that file, or when you want a small pattern-only project file. If both .worktreeinclude and file_include_globs exist, .worktreeinclude wins.
What gets copied
Git worktrees do not copy untracked files from your main checkout. That includes:
- Gitignored environment files such as
.env.local,.env.development.local, and.env.test.local. - Local config files such as
config/local.json,settings.local.json, or*.local. - Credentials and tokens such as service account JSON files, API key files, and local certificate files.
- Local database files, seed data, or fixture files that are intentionally ignored by Git.
- Dependency folders, cache directories, and generated build output such as
node_modules,.next,dist, ortarget.
Conductor copies a gitignored file into a new local workspace when both of these are true:
- The file is gitignored.
- The file matches a Files to copy or
.worktreeincludepattern.
Tracked files are already present in the new worktree, so Conductor does not copy them. Untracked files that are not gitignored are not eligible for Files to copy. Generated files, dependency folders, and files that need commands to create them usually belong in a setup script instead.
Files to copy currently runs for local Mac workspaces.
Resolution order
The patterns used for a given repo come from the first source that exists:
.worktreeincludeat the repo root. If present, the file's contents win and the settings UI shows a read-only preview.- Repo settings (
Settings -> {repo name} -> Files to copy), stored asfile_include_globsin repository settings. - Default pattern
.env*.
For project-shared patterns, commit a .worktreeinclude file at the repo root or set file_include_globs in .conductor/settings.toml. .worktreeinclude wins when both exist.
If you add .worktreeinclude or repo settings, those patterns replace the default .env* pattern. Include .env* yourself when you still want Conductor to copy environment files.
Pattern format
.worktreeinclude uses .gitignore syntax. Anthropic documents the same behavior for Claude Code worktrees.
Common pattern rules:
- Blank lines are ignored.
#starts a comment. Escape it as\#when the pattern itself starts with#.!negates a previous match. Escape it as\!when the pattern itself starts with!.- A trailing
/matches a directory only. - A leading
/anchors the pattern to the repo root. - A slash in the middle of a pattern makes the pattern relative to the repo root.
*matches anything except/.?matches one character except/.- Character ranges such as
[0-9]match one character in the range. **/namematchesnameat any depth.directory/**matches everything insidedirectoryat any depth.a/**/bmatchesa/b,a/x/b,a/x/y/b, and deeper nested paths.
Examples
Copy common environment files:
.env
.env.*Copy a root-only local file without copying files with the same name in packages:
/config/local.jsonCopy nested secrets config files:
**/secrets.local.json
config/**/local.jsonCopy a directory of ignored local data, except examples:
.local-secrets/**
!.local-secrets/**/*.exampleRelated pages
- Use Files to copy for a guided setup flow.
.worktreeincludefor the shared project file format.- Git worktrees for coding agents for the underlying worktree model.
- Run Claude Code with Git worktrees and Run Codex with Git worktrees for agent-specific worktree workflows.