git-clean-branches
v1.0.3
Published
A CLI tool to delete local Git branches that have already been merged into the base branch.
Maintainers
Readme
git-clean-branches
A CLI tool to delete local Git branches that have already been merged into the base branch.
Install
npm install --global git-clean-branchesUsage
npx clean-branches [options]Options
-h --help Print this help
-v --version Print git-clean-branches version number
-b --base <branch> Specify base branch (default: master)
-p --dry-run Preview branches to delete without deleting
-e --exclude <branch> Exclude branch from deletion (supports glob patterns, can be repeated)
-f --force Force delete branches (use -D instead of -d)Examples
# Clean up branches already merged into the default 'master' branch
npx clean-branches
# Clean up branches already merged into the 'main' branch
npx clean-branches --base 'main'
# Clean up branches merged into 'master' excluding 'staging'
npx clean-branches --exclude 'staging'
# Clean up branches merged into 'master' excluding 'feature/*'
npx clean-branches --exclude 'feature/*'
# Preview the branches that have been merged into the default 'master' branch
npx clean-branches --dry-run
# Force delete branches that have been merged into 'master'
npx clean-branches --forceLICENSE
This project is created using generator-stupid-cli.
