branchkiller v0.2.3
Branch Killer
A command-line tool to easily delete all git local and remote branches except 'main'. Delete Git branches in bulk ✂️
Table of Contents
:heavy_check_mark: Features
Delete Local Branches: Easily manage and remove unnecessary local branches in your Git repository with an interactive CLI interface.
Delete Remote Branches: Clean up remote branches that are no longer needed by pushing deletions directly to the origin.
Branch Exclusion: Exclude specific branches (e.g., main, origin/main) from being selected for deletion to avoid accidental removal of important branches.
Interactive Selection: Choose which branches to delete through a user-friendly prompt, with checkboxes for easy multi-selection.
Confirmation Step: Prevent accidental deletions by requiring confirmation before proceeding with branch removal.
:cloud: Installation
$ npm i -g branchkiller
:clipboard: Usage
$ branchkiller
By default, branchkiller will scan your local and remote branches, excluding branches like your current local branch, main and origin/main from being selected for deletion.
Options
ARGUMENT | DESCRIPTION |
---|---|
-e, --exclude branches... | Exclude branches (default: "main","origin/main",current local branch) |
--no-local | Do not delete local branches |
--no-remote | Do not delete remote branches |
--no-interactive | Do not ask for confirmation before deleting branches |
-f, --force | Force branch deletion |
-V, --verbose | Be verbose when deleting branches, showing them as they are deleted |
-h, --help | Display help for command |
-v, --version | Display branchkiller version |
Examples
- Exclude local branch
branchkiller --exclude mylocalbranch
# other alternative:
branchkiller -e mylocalbranch
- Exclude remote branch
branchkiller --exclude origin/myremotebranch
# other alternative:
branchkiller -e origin/myremotebranch
- Exclude multiple branches (local and remote)
branchkiller --exclude mylocalbranch origin/myremotebranch
# other alternative:
branchkiller -e mylocalbranch origin/myremotebranch
:hammer_and_wrench: Contributing
Contributions are welcome! Please feel free to fork the repository, make changes, and submit pull requests.
:scroll: License
MIT © Sergio Navarro