Overview
Clean Up Project Resources
Remove obsolete backup files and stale Git branches while keeping your project organized and maintainable.
custy cleanupCategory
Quick Command
custy cleanup <subcommand>Overview
The cleanup command removes resources that are no longer needed after regular development activities.
Custy currently supports two independent cleanup operations:
-
Backup Cleanup — removes older backup files while preserving the newest backups according to the configured retention policy.
-
Branch Cleanup — removes Git branches that match user-defined cleanup rules while protecting important branches such as
main,master, anddevelop.
Although both operations belong to the same command family, they serve different purposes and have different safety characteristics.
Cleanup Types
Available Cleanup Operations
Backup Cleanup
Branch Cleanup
Automatic vs Manual Cleanup
| Cleanup Operation | Automatic | Manual | Purpose |
|---|---|---|---|
| Backup Cleanup | ✅ Yes | ✅ Yes | Remove old backup files. |
| Branch Cleanup | ❌ No | ✅ Yes | Remove obsolete Git branches. |
Backup cleanup may execute automatically during certain Custy workflows.
Branch cleanup is intentionally performed manually because it modifies the Git repository.
Workflow Integration
Some cleanup operations can participate in workflow pipelines, while others are intentionally manual because they modify Git resources.
Backup cleanup is integrated into several Custy workflow pipelines and helps keep backup directories organized automatically.
Branch cleanup is intentionally excluded from automated release workflows and must be executed manually to avoid accidental branch removal.
Configuration Driven
Cleanup behavior is primarily controlled through your project's
config.toml.
Examples of configurable behavior include:
- Backup retention count.
- Branch name prefixes.
- Merge status filters.
- Branch age filters.
- Branch date filters.
This allows each project to define maintenance rules that match its own Git workflow.