davidraviv / gh-clean-branches

Safely deletes local branches with no upstream and no un-pushed commits
MIT License
177 stars 15 forks source link
cli gh-extension git-branches local-environment

Clean Branches

Description

Github CLI extension

Safely delete local branches that have no remotes and no hanging changes.

The extension uses git branch -d to delete the local branches, hence it will not delete branches with un-pushed changes unless using --force flag.

The extension supports single or multiple upstream.

Installation

gh extension install davidraviv/gh-clean-branches

Usage

Execute it inside a git repo folder:

gh clean-branches [--dry-run] [--force] [--verbose]

Options

Script flow

Dependencies

The extension depends on: