branch-purge
v0.1.6
Published
Local Git branch cleanup CLI with a filterable web UI.
Maintainers
Readme
Branch Purge
Branch Purge is a standalone local Git branch cleanup tool. It starts a localhost web UI for searching, filtering, selecting, and deleting local branches in any Git repository.
The default mode is local-only. It reads existing local refs and remote-tracking refs without contacting the network. Fetching and pruning remote-tracking refs only happens when requested explicitly.
Install
From this repository, install the package binary globally:
npm install -g .For local development, you can link the package instead:
npm linkVerify the CLI is available:
branch-purge --helpUsage
Install from npm:
npm install -g branch-purgeThen run:
branch-purge serve --repo /path/to/repo --base devRun from this repository:
node src/cli.mjs serve --repo /path/to/repo --base devOr use the package binary after linking or installing:
branch-purge serve --repo /path/to/repo --base devOptions:
--repo PATH Git repository to inspect. Defaults to the current directory.
--base BRANCH Branch used for merged status. Defaults to dev, main, master, then current.
--fetch Run git fetch --prune once before starting the server.
--port PORT Local server port. Defaults to a random open port.
--no-open Do not open the browser automatically.Safety Model
- Uses
git branch -dfor normal local branch deletion. - Requires explicit force mode in the UI before using
git branch -D. - Protects the current branch, base branch,
main,master, anddev. - Does not delete remote branches.
- Does not run
git fetch --pruneunless--fetchis passed or the UI refresh button is confirmed. - Binds the web server to
127.0.0.1and requires an ephemeral request token for mutating browser requests.
Development
npm testCheck the package contents before publishing:
npm run pack:dry-runPublishing
Only maintainers with npm package access can publish a release.
npm version patch
npm publish