How-to Guides
Use Files to copy
Copy .env files and other gitignored local config into local Conductor workspaces
Use Files to copy when every new local Conductor workspace needs the same gitignored local files before the app can run.
The common case is .env.local: it should not be committed, but local workspaces still need it. A shared .worktreeinclude file lets Conductor copy it automatically.
Before you start
You need:
- A repository already added to Conductor.
- A local Mac workspace. Files to copy does not currently run for cloud workspaces.
- A local file that exists in your main checkout, such as
.env.local. - A
.gitignorerule that ignores that file.
Git worktrees start with tracked files only. They do not copy untracked files, gitignored files, local credentials, local config, generated files, dependency folders, or caches from your main checkout.
Conductor's default Files to copy pattern is .env*, so gitignored files like .env.local are copied by default. Files outside that pattern are not copied unless you add matching Files to copy or .worktreeinclude patterns. Files to copy only copies files that Git already ignores. If the file is tracked, it will already be present in new worktrees.
Set up Files to copy
Choose the files
Start with the files your app needs to boot in a new local workspace:
.env.local
config/local.json
certs/local.pemDo not include dependency folders or generated build outputs unless you have a strong reason. A setup script is usually better for generated workspace state.
Create .worktreeinclude
Create .worktreeinclude at the repo root:
.env.local
config/local.json
certs/local.pemYou can also use .gitignore syntax:
.env*
config/**/local.json
certs/**
!certs/**/*.exampleFor the full syntax, including nested globs and negation, see the Files to copy reference.
Commit the patterns
Commit .worktreeinclude so the project shares the same copy rules:
git add .worktreeinclude
git commit -m "Add worktree include patterns"Do not commit the files matched by .worktreeinclude. They should stay gitignored.
Create a new workspace
Create a new Conductor workspace with Command N.
When Conductor creates the local workspace, it checks the repo root for .worktreeinclude, lists gitignored files, and copies matching files into the new workspace.
Verify the workspace
Open the terminal in the new local workspace and check for one expected file:
test -f .env.local && echo "Copied"If the file is missing, check these first:
.worktreeincludeis at the repo root.- The pattern matches the path from the repo root.
- The target file exists in the main checkout.
- The target file is ignored by Git.
Personal patterns
If you do not want to commit shared patterns, use Repository Settings instead:
- Open Settings.
- Select the repository.
- Add one pattern per line in Files to copy.
When .worktreeinclude exists at the repo root, it takes precedence and the settings UI becomes read-only for that repository.
For the underlying model and tradeoffs, see Manage secrets with .worktreeinclude.