Skip to main content

Workflow

Workflow

Advanced

Understand how Custy evaluates configured cleanup rules before removing Git branches.

Commandcusty cleanup branches

Category

Maintenance

Quick Command

custy cleanup branches

workflowcleanupbranch

Overview​

Branch Cleanup follows a multi-stage evaluation process before deleting any Git branches.

Rather than deleting branches immediately, Custy progressively filters the available branches until only eligible candidates remain.

This layered approach helps minimize the risk of accidental branch removal.


Branch Cleanup Workflow

High-level execution sequence.

1
Load Configuration
Resolve cleanup rules from command-line options, project configuration, and built-in defaults.
completed
2
Inspect Repository
Retrieve local Git branches and collect metadata used during cleanup.
completed
3
Apply Cleanup Filters
Evaluate branch prefixes, merge status, age filters, and protected branch rules.
completed
4
Remove Eligible Branches
Delete only branches that satisfy every configured cleanup rule.
completed
5
Display Summary
Present the cleanup results and any skipped branches.
completed

Workflow Stages

1. Resolve Cleanup Configuration
pending
2. Inspect Local Branches
pending
3. Apply Cleanup Rules
pending
4. Remove Eligible Branches
pending
5. Report Results
pending

Before Cleanup

Branches before cleanup
Repository state before Branch Cleanup. Multiple release branches are still present.

Cleanup Execution

Branch cleanup process
Custy evaluates the configured filters and removes only eligible branches.

After Cleanup

Branches after cleanup
Only the eligible release branches have been removed. Protected and non-matching branches remain.


Filtering Pipeline

Conceptually, every branch passes through the following evaluation stages:

  1. Prefix filter
  2. Merge status filter
  3. Age filter (if configured)
  4. Protected branch check

Only branches that successfully pass every stage are eligible for deletion.


What's Next?

Continue to the Examples page to see common Branch Cleanup scenarios and recommended configurations.