Skip to content
CLI tool to delete Git branches
Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
bin
exe
lib
test
.gitignore
.ruby-version
CODE_OF_CONDUCT.md
Gemfile
Gemfile.lock
LICENSE.md
README.md
Rakefile
pruner.gemspec

README.md

StandardRB Tests


Logo

Pruner

A small Ruby Gem to help you delete Git branches.


Notice

This implementation is a bit naive so be careful. If you select the current branch you have checked out, the gem will not delete it.

Installation

gem install pruner

Usage

Inside of a repository working directory:

pruner

A multiselect prompt will appear. Use the arrow keys to move between branch names, and hit the spacebar on branches you want to delete. When you have finished making your selections, hit Enter.

The gem will then delete your branches! It's as easy as that.

Example

Step 1

Run the pruner command.

➜ pruner

Step 2

Use the spacebar to select the branches you want to delete and hit Enter.

➜ pruner

==== Select branches to delete ====
 test_1, test_2, test_3
  ⬡ master
  ⬢ test_1
  ⬢ test_2
‣ ⬢ test_3

Step 3

Type Y and then hit Enter.

➜ pruner

==== Select branches to delete ====
 test_1, test_2, test_3

==== Are you sure you want to delete these branches? ====
→ (Y/n) Y

Step 4

The branches will be deleted and the output will look like the output below.

➜ pruner

==== Select branches to delete ====
 test_1, test_2, test_3

==== Are you sure you want to delete these branches? ====
→ Yes

==== Deleting Branches ====
- test_1
- test_2
- test_3

==== Branches Deleted ====

Development

After checking out the repo, run bin/setup to install dependencies.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/andrewmcodes/pruner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Coding Standards

This project uses Standard to minimize bike shedding related to code formatting.

Code of Conduct

Everyone interacting in the Pruner project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

You can’t perform that action at this time.