How To: Prune Workspace Size
Reduce disk usage by enabling top-level pruning of non‑documentation directories inside cloned repositories.
Enable Pruning
Control Allow / Deny Lists
Precedence (highest wins):
.git(never removed)- Explicit deny (glob or exact)
- Docs roots (derived from first segment of each configured docs path)
- Explicit allow
- Removal
When To Use
- Large monorepos where only
docs/subtree is needed. - CI environments with tight ephemeral storage quotas.
Risks
- Removing assets (images, includes) referenced by Markdown if they live outside allowed roots.
Mitigation
- Add required top-level directories to
prune_allow. - Temporarily disable pruning to confirm root cause of missing references.
Example
Repository tree:
Config:
Result keeps .git, docs/, README.md; prunes build/, cmd/, scripts/.
Verification
Inspect repo directory after clone stage (verbose logging) or script a simple check: