website/docs/cli-reference/compact.md
Generated from bd help --doc compact
Squash Dolt commits older than N days into a single commit.
Recent commits (within the retention window) are preserved via cherry-pick. This reduces Dolt storage overhead from auto-commit history while keeping recent change tracking intact.
For semantic issue compaction (summarizing closed issues), use 'bd admin compact'. For full history squash, use 'bd flatten'.
How it works:
Examples: bd compact --dry-run # Preview: show commit breakdown bd compact --force # Squash commits older than 30 days bd compact --days 7 --force # Keep only last 7 days of history bd compact --days 90 --force # Conservative: squash 90+ day old commits
bd compact [flags]
Flags:
--days int Keep commits newer than N days (default 30)
--dry-run Preview without making changes
-f, --force Confirm commit squash