<commit_before>git-clean
===========
# The Problem
If you work on one project for a long time, you're bound to amass a good number
of branches. Deleting these branches locally whenever you're done with them
gets annoying, and can cost you a lot of time in branch grooming, or trying to
remember 'that command' to delete all merged branches locally.

`git-clean` looks to remedy that. By running `git-clean`, you'll delete all
your merged branches quickly and easily.

# Other implementations
There are a couple other tools out there like this, but they all fall short for
me in some way.

https://github.com/arc90/git-sweep

This tool works great for smaller projects, but if you work on a large project
with tens or hundreds of thousands of commits, and thousands of active
branches, it stalls out. I've tried several times to get it to work on these
larger projects, but I've never been able to. It also has troubles deleting
branches locally if they've already been deleted in the remote.

https://github.com/mloughran/git-clean

This tool takes a slightly different approach, it will show you each branch
sequentially and let you decide what to do with it. This might work great for
some people, but I usually end up cleaning out my branches when the output of
`git branch` becomes unmanagable, so I would rather batch delete all my merged
branches in one go.

https://github.com/dstnbrkr/git-trim

This tool does something reminiscent of interactive rebasing, it will display
*all* of your branches in your text editor, let you choose which ones you want
to delete, and deletes them upon saving.  My problems with this are: It's a
manual process - and, - It doesn't only display merged branches, meaning that
you could delete branches that have valuable work on it.

# Advantages to this project
- Fast

This project is written in Rust, which is [really stinkin
fast](http://benchmarksgame.alioth.debian.org/u64q/rust.html). It takes about
1.8 seconds to delete 100+ branches, and most of that is network time.
`./target/release/git-clean  0.07s user 0.08s system 8% cpu 1.837 total`

- Batch operations

It deletes your branches in bulk, no stepping through branches or selecting
what branches you want gone. It assumes you want to delete all branches that
are even with your base branch.

- Deletes local and remote

It deletes both local and remote branches, and handles the errors if the remote
is already deleted.

- Only presents merged branches

There's no possibly of deleting branches with valuable work on it, as it only
deletes branches that are even with the base branch you specify (default
master).

# Assumptions
This tool assumes that you have `git` installed, and is in your path. If you
don't have it installed, I'm confused as to why you've read this far, but go
[here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to learn
how to install it.

It also assumes that your `git` is properly configured to push and pull from
the current repository. `git-clean` should be run from the directory that<commit_msg>readme typo<commit_after>git-clean
===========
# The Problem
If you work on one project for a long time, you're bound to amass a good number
of branches. Deleting these branches locally whenever you're done with them
gets annoying, and can cost you a lot of time in branch grooming, or trying to
remember 'that command' to delete all merged branches locally.

`git-clean` looks to remedy that. By running `git-clean`, you'll delete all
your merged branches quickly and easily.

# Other implementations
There are a couple other tools out there like this, but they all fall short for
me in some way.

https://github.com/arc90/git-sweep

This tool works great for smaller projects, but if you work on a large project
with tens or hundreds of thousands of commits, and thousands of active
branches, it stalls out. I've tried several times to get it to work on these
larger projects, but I've never been able to. It also has troubles deleting
branches locally if they've already been deleted in the remote.

https://github.com/mloughran/git-clean

This tool takes a slightly different approach, it will show you each branch
sequentially and let you decide what to do with it. This might work great for
some people, but I usually end up cleaning out my branches when the output of
`git branch` becomes unmanagable, so I would rather batch delete all my merged
branches in one go.

https://github.com/dstnbrkr/git-trim

This tool does something reminiscent of interactive rebasing, it will display
*all* of your branches in your text editor, let you choose which ones you want
to delete, and deletes them upon saving.  My problems with this are: It's a
manual process - and, - It doesn't only display merged branches, meaning that
you could delete branches that have valuable work on it.

# Advantages to this project
- Fast

This project is written in Rust, which is [really stinkin
fast](http://benchmarksgame.alioth.debian.org/u64q/rust.html). It takes about
1.8 seconds to delete 100+ branches, and most of that is network time.
`./target/release/git-clean  0.07s user 0.08s system 8% cpu 1.837 total`

- Batch operations

It deletes your branches in bulk, no stepping through branches or selecting
what branches you want gone. It assumes you want to delete all branches that
are even with your base branch.

- Deletes local and remote

It deletes both local and remote branches, and handles the errors if the remote
is already deleted.

- Only presents merged branches

There's no possibility of deleting branches with valuable work on them, as it
only deletes branches that are even with the base branch you specify (defaults
to master).

# Assumptions
This tool assumes that you have `git` installed, and is in your path. If you
don't have it installed, I'm confused as to why you've read this far, but go
[here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to learn
how to install it.

It also assumes that your `git` is properly configured to push and pull from
the current repository. `git-clean` should be run from the directory that
{'fraction_non_alphanumeric': 0.055054891037194825, 'fraction_numerical': 0.006881861379649353, 'mean_word_length': 4.239484978540773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1579703', 'n_tokens_mistral': 1656, 'n_tokens_neox': 1570, 'n_words': 949}