Skip to main content

Syntax

Syntax

Advanced

Learn how to execute Branch Cleanup using direct commands or workflow stages.

Commandcusty cleanup branches

Category

Maintenance

Quick Command

custy cleanup branches

cleanupbranchsyntax

Overview​

Branch Cleanup removes local Git branches that satisfy your configured cleanup rules.

The command supports both direct execution and execution as an individual workflow stage.

Branch selection is always determined by your project's cleanup configuration.


Basic Syntax

Command Syntax

Available command syntax and usage examples.

Branch Cleanup

Remove eligible Git branches using the configured cleanup rules.

bash
custy cleanup branches


Global Options

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

Examples include:

Terminal
bash
custy --dry-run cleanup branches
Terminal
bash
custy --debug cleanup branches
Terminal
bash
custy --log-level DEBUG cleanup branches

Global options are always specified before the command.


Execution Modes

Branch Cleanup has one public command form.

Standalone Command​

custy cleanup branches

Used when you explicitly want to clean obsolete Git branches.

The internal branch-cleanup profile is intentionally not part of the public release or full profiles, keeping branch deletion an explicit operation.



Exit Behavior

When execution completes, Custy reports one of several outcomes.

For example:

  • eligible branches were removed,
  • no branches matched the configured filters,
  • no cleanup was performed because no branch prefixes were configured.

Each outcome is considered a successful execution when it reflects the current project configuration.


What's Next?

Continue to the Options page to learn about the command-specific options supported by Branch Cleanup before exploring the configuration filters.