branch-cleaner

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 9 Imported by: 0

README

branch-cleaner

A simple CLI tool to remove local git branches that are no longer present on the remote.

Demo

Installation

Install using Go:

go install github.com/StevenCyb/branch-cleaner@latest
# Add this to ~/.zshrc or other shell config file:
export PATH=$PATH:$HOME/go/bin
# Then reload your shell:
source ~/.zshrc

Usage

Run in the current directory:

branch-cleaner

Or specify a path to a git repository:

branch-cleaner /path/to/repo

Features

  • Lists local branches not present on remote
  • Shows branch name, dirty flag, and last commit time in a table
  • Use arrow up/down to select branches
  • Press to mark/unmark branches for deletion
  • Press to delete marked branches and exit
  • If no branches to delete, prints a message and exits

Disclaimer

Use with caution. This tool will permanently delete local branches. Always review the list of branches before confirming deletion. Consider backing up your repository before using this tool. The author is not responsible for any data loss or issues caused by using this tool.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL