Skip to main content

Options

Options

Advanced

Customize how Branch Cleanup evaluates and removes Git branches.

Commandcusty cleanup branches

Category

Maintenance

Quick Command

custy cleanup branches

cleanupbranchoptions

Overview

Branch Cleanup intentionally provides only a small number of command-line options.

Most cleanup behavior is configured once in your project's config.toml, allowing every team member to use consistent cleanup rules.


Available Options

Command Options

Available command-line options.

--include-prefix-i
Optional

Temporarily include one or more branch name prefixes during the current cleanup operation.
--merge-status-m
Optional

Limit cleanup to merged, unmerged, or all matching branches.
--max-age
Optional

Only consider branches older than the specified relative age.
--before
Optional

Only consider branches whose latest commit occurred before the specified date.

Configuration Takes Priority

Although these options are available from the command line, most projects prefer to define cleanup behavior in config.toml.

This keeps cleanup rules consistent across every contributor working on the repository.


Global Options

Like every Custy command, Branch Cleanup also supports the global CLI options.

Examples include:

  • --dry-run
  • --debug
  • --log-level

Global options are always placed before the command.

Example:

custy --dry-run cleanup branches


Configuration Resolution

When an option is omitted, Custy resolves the effective value using the following priority:

  1. Command-line option.
  2. Project configuration (config.toml).
  3. Built-in default value.

This resolution strategy provides consistent behavior while still allowing temporary overrides for individual executions.


What's Next?

Continue to the Configuration page to learn how each cleanup filter works, including branch prefixes, merge status, age filters, and protected branches.