Why do I need to copy files into a worktree?
git worktree add checks out only what is committed. Files your .gitignore excludes, such as .env, local certificates or a config/secrets.json, are not there, so a dev server or test run in the new worktree fails until you copy them. microManager does this for you every time it creates or restores a workspace.
How does microManager decide which files to copy?
It uses the first of these that the repository has:
| Order | Source | Format |
|---|---|---|
| 1 | .worktreeinclude in the repository root |
One pattern per line, written like .gitignore |
| 2 | file_include_globs in the repository settings |
A list of glob patterns in TOML |
| 3 | Built-in default | .env* |
Only one source is used: a .worktreeinclude file replaces file_include_globs rather than adding to it.
What does a .worktreeinclude file look like?
# .worktreeinclude
.env
.env.local
config/secrets.json
certs/*.pem
Lines follow .gitignore rules: # starts a comment, * matches within a folder and ** across folders. The same file name is read by other tools, including Claude Code’s desktop app and Codex in the ChatGPT desktop app, so one file can serve all of them.
How do I set file_include_globs?
# .conductor/settings.toml or .micromanager/settings.toml
file_include_globs = [".env", ".env.*", "apps/*/.env.local"]
Conductor’s key and format are read as they are, including its other form, one string with a pattern per line. A personal list can go in settings.local.toml, which takes precedence over the shared file.
Which files are never copied or overwritten?
- Only ignored or untracked files are copied. A file that git tracks already comes with the checkout.
- Nothing is overwritten. If a file already exists in the new worktree, microManager leaves it alone.
- Ignored folders are searched only when a pattern points into them.
.env*does not pull.envfiles out ofnode_modules, whileconfig/**does reach into an ignoredconfig/folder. - Nothing is copied through a linked folder. If a folder in the new worktree is a symlink, files under it are skipped, so a copy never lands outside the worktree.
- Files come from the repository’s main checkout (the folder you added,
$MICROMANAGER_ROOT_PATH), never from another workspace.
Can a setup script do the rest?
Yes. For anything copying cannot do, such as generating a file or linking a shared folder, use the setup script, which runs after the files are copied and can read $MICROMANAGER_ROOT_PATH.