clear-git-branch v1.1.1
clear-git-branch
Sometime your local envirement will get a little bit slower due to the number of branches that you may have created while working on a project, this package helps you clean up your local environment from unused branches git branches.
Installation & Usage
npx clear-git-branch --help
# or
npm install -g clear-git-branchFeatures
Here's a list of options that this CLI supports now
Use
-aor--allif you want to delete all branches expectmaster&main(the flag-ahas a higher priority then-xflag so please use one of them at a time).Use
-cor--cleanif you want to delete all branches exceptmaster,main,develop&development.Use
-for--featuresif you want to delete all branches that start with[fF]eature/*or[fF]eatures/*.Use
-hor--hotfixesif you want to delete all branches that start with[hH]otfix/*or[hH]otfixs/*.Use
-xor--exceptif you want to exclude a list of branches from being deleted, seperate them with a comma.If you want to clear your remote branches simply run
clear-git-branch remote ${REMOTE} #REMOTE is the remote that you want to cleanNote that the -a or --all flag has higher priority than all the other flags, so please use it carefully.
Examples
# to get the list of options
npx clear-git-branch --help
# to delete all feature/* branches
npx clear-git-branch -f
# to delete all hotfix/* branches
npx clear-git-branch -h
# to delete all branches
npx clear-git-branch -a
# to clean all branches
npx clear-git-branch -cLicenses
MIT
Collaborators
- Yacine BENKAIDALI yacinebenkaidali@gmail.com