keep-branches

command module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 7 Imported by: 0

README

keep-branches

keep-branches is a CLI tool used to prune local git repository of unwanted branches.

The tool will prune branches that are

  • not main
  • not the current branch
  • not listed as an argument

GitHub

Install

The keep-branches tool is available to download from the Releases page.

It is pre-compiled for many operating systems and architectures including

  • Linux
  • Windows
  • MacOS
  • FreeBSD
  • OpenBSD

Build

The keep-branches command can be compiled from source using the Go tool chain.

Short version:

go install github.com/shoenig/keep-branches@latest

Examples

Keep only main

keep-branches

Keep main, x-my-branch, x-foo-branch

keep-branches x-my-branch x-foo-branch

Print help message

keep-branches -help

Contributing

The github.com/shoenig/keep-branches command is always improving with new features and bug fixes. For contributing please file an issue or pull request.

License

The github.com/shoenig/keep-branches command is open source under the MPL 2.0 license.

Documentation

Overview

Command keep-branches is used to prune your local git repository of unwanted feature branches, etc.

Jump to

Keyboard shortcuts

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