Skip to main content

Examples

Examples

Advanced

Learn how to remove obsolete Git branches using common Branch Cleanup scenarios.

Commandcusty cleanup branches

Category

Maintenance

Quick Command

custy cleanup branches

examplescleanupbranch

Overview

The following examples demonstrate common ways to execute Branch Cleanup.

Remember that the actual branches selected for cleanup are determined by your project's configuration and cleanup filters.


Basic Examples

Examples

Practical command examples.

Cleanup Using Project Configuration

Remove branches using the cleanup rules defined in config.toml.

CLI
custy cleanup branches


Temporary Configuration Overrides

Examples

Practical command examples.

Cleanup Only Release Branches

Temporarily include release branches during cleanup.

CLI
custy cleanup branches --include-prefix release/

Cleanup All Matching Branches

Ignore merge status during cleanup.

CLI
custy cleanup branches --merge-status all


Age Filter Examples

Examples

Practical command examples.

Branches Older Than Thirty Days

Only consider older branches.

CLI
custy cleanup branches --max-age 30d

Branches Before a Specific Date

Select branches whose latest commit occurred before a fixed date.

CLI
custy cleanup branches --before 2026-07-01


Global Options

Examples

Practical command examples.

Preview Branch Cleanup

Review the cleanup operation without deleting branches.

CLI
custy --dry-run cleanup branches

Debug Branch Cleanup

Run Branch Cleanup with additional diagnostic information.

CLI
custy --debug cleanup branches



What's Next?

Continue to the Output page to learn how Custy reports the results of a Branch Cleanup operation.