.foundry/ Directory
The .foundry/ directory lives alongside foundry.json at the project root. It holds one committed file and the local-only files, with the split enforced by a nested .foundry/.gitignore that Foundry writes.
File layout
.foundry/
├── .gitignore # Managed by Foundry — ignores config.yml
├── workspace.yml # ✓ COMMITTED — service path map + drift
├── config.yml # ✗ gitignored — personal config / credential pointers
└── config.defaults.yml # optional, committed — shared defaults merged under config.ymlCommit strategy
| File | Committed? | Purpose |
|---|---|---|
.gitignore | ✓ | Managed by Foundry — ignores config.yml |
workspace.yml | ✓ | Resolved service→path map and drift; written by foundry sync |
config.yml | ✗ | Personal preferences, tokens, SSH tunnels — never committed |
config.defaults.yml | ✓ (optional) | Team-shared defaults, deep-merged under config.yml |
How the gitignore works
Foundry does not add .foundry/ to the root .gitignore. Instead it writes a nested .foundry/.gitignore that ignores only the local file:
# .foundry/.gitignore — managed by foundry
# Only workspace.yml is committed.
config.ymlSo workspace.yml (and an optional config.defaults.yml) are tracked naturally, while config.yml stays local even if you git add ..
Legacy migration
If your root .gitignore still has a blanket .foundry/ entry from an older Foundry version, foundry init removes it and switches to the nested strategy so workspace.yml is committed.