mcasper / git-clean

A Command Line Tool written in Rust for cleaning up local and remote Git branches
MIT License
54 stars 9 forks source link

blacklist certain branches #29

Open jfrost opened 4 years ago

jfrost commented 4 years ago

It would be great to list certain branches as blacklisted for consideration. For example, we use a releases branch on some repos that git-clean wants to clean.

alisonjenkins commented 4 weeks ago

It would be great to list certain branches as blacklisted for consideration. For example, we use a releases branch on some repos that git-clean wants to clean.

Just checked the help on the tool as is at the moment and it has the ignore option that you requested:

A tool for cleaning old git branches.

Usage: git-clean [OPTIONS]

Options:
  -l, --locals                    Only delete local branches
  -r, --remotes                   Only delete remote branches
  -y, --yes                       Skip the check for deleting branches
  -s, --squashes                  Check for squashes by finding branches incompatible with main
  -d, --delete-unpushed-branches  Delete any local branch that is not present on the remote. Use this to speed up the checks if such branches should always be considered as merged
  -R, --remote <remote>           Changes the git remote used (default is origin) [default: origin]
  -b, --branch <branch>           Changes the base for merged branches (default is main) [default: main]
  -i, --ignore <ignore>           Ignore given branch (repeat option for multiple branches)
  -h, --help                      Print help
  -V, --version                   Print version

Is --ignore as is not what you want? Or can this now be closed?