Skip to main content

Configuration

Configuration

Advanced

Customize how Custy selects Git branches for cleanup.

Commandcusty cleanup branches

Category

Maintenance

Quick Command

custy cleanup branches

configurationcleanupbranch

Overview

Branch Cleanup is primarily controlled through your project's config.toml.

Rather than requiring long command-line invocations, Custy allows teams to define consistent cleanup rules that apply across the entire project.

All cleanup decisions are derived from these configuration values.



Cleanup Configuration

config.toml Cleanup Configuration Properties

Configuration fields available under the Branch Cleanup section of your project's config.toml. The following configuration fields control how Custy selects branches eligible for cleanup.

PropertyTypeDescriptionDefaultRequired
include_prefixesstring[]List of branch name prefixes eligible for cleanup.-Yes
merge_statusmerged | unmerged | allRestrict cleanup based on merge status.mergedNo
max_agedurationOnly consider branches older than the specified relative age.-No
beforedateOnly consider branches whose latest commit occurred before a specific date.-No

Branch Prefixes

The most important configuration is:

include_prefixes = [
"release/",
"feature/",
]

Custy never attempts to clean every branch.

Instead, only branches whose names begin with one of the configured prefixes are considered.

For example:

  • release/v2.0
  • release/archive
  • feature/login

would all become eligible for further evaluation.

Branches with different names are ignored.



Merge Status

Merge status determines whether Custy considers:

ValueDescription
mergedOnly merged branches.
unmergedOnly unmerged branches.
allIgnore merge status completely.

Most projects use the default:

merge_status = "merged"

to remove branches that have already been integrated into the main development history.


Relative Age Filter

The optional age filter excludes recently updated branches.

Example:

max_age = "30d"

Supported units include:

  • minutes (m)
  • hours (h)
  • days (d)
  • weeks (w)
  • months (mo)
  • years (y)

Only branches older than the configured duration are considered.


Absolute Date Filter

Instead of using a relative duration, you may specify an absolute cutoff date.

Example:

before = "2026-07-01"

Only branches whose most recent commit occurred before that date become eligible.

before and max_age are mutually exclusive.


Protected Branches

Regardless of the configured filters, Custy always protects important branches.

The default protected branches are:

  • main
  • master
  • develop

Even if these branches match every configured filter, they are never removed.



Configuration Strategy

A recommended configuration for many projects looks like:

Terminal
bash
include_prefixes = [
"release/",
]

merge_status = "merged"

max_age = "30d"

This configuration removes merged release branches that have not been updated for at least thirty days while leaving all other branches untouched.


What's Next?

Continue to the Workflow page to see how Custy evaluates these filters step by step before deleting any branches.