.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.yml

Commit strategy

FileCommitted?Purpose
.gitignoreManaged by Foundry — ignores config.yml
workspace.ymlResolved service→path map and drift; written by foundry sync
config.ymlPersonal 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.yml

So 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.