git-branch-clean-cli
v1.0.0
Published
Clean up merged and stale git branches interactively
Maintainers
Readme
git-branch-clean-cli
Clean up merged and stale git branches interactively.
Installation
npm install -g git-branch-clean-cliUsage
# List merged branches that can be deleted
git-branch-clean
# Preview what would be deleted (no actual deletion)
git-branch-clean --dry-run
# Delete without confirmation
git-branch-clean --force
# Also clean remote branches
git-branch-clean --remote
# Mark branches as stale after 30 days instead of default 90
git-branch-clean --stale-days 30
# Protect branches matching a pattern
git-branch-clean --protect "release/*"
# Output as JSON
git-branch-clean --json
# Combine options
git-branch-clean --remote --force --stale-days 60 --protect "hotfix/*"Options
| Option | Description |
|---|---|
| --dry-run | Preview deletions without executing them |
| --force | Delete branches without confirmation |
| --remote | Also clean remote tracking branches |
| --stale-days <n> | Days of inactivity before a branch is stale (default: 90) |
| --protect <pattern> | Regex pattern for branches to protect (repeatable) |
| --json | Output results as JSON |
| -V, --version | Show version |
| -h, --help | Show help |
Protected Branches
The following branches are always protected and never deleted:
mainmasterdevelopstagingproduction
License
MIT
