{"id":24732635,"url":"https://github.com/jmlavoier/clear-branches","last_synced_at":"2025-09-19T06:43:01.542Z","repository":{"id":40686021,"uuid":"295177744","full_name":"jmlavoier/clear-branches","owner":"jmlavoier","description":"Easy way to clear your local branches","archived":false,"fork":false,"pushed_at":"2023-10-23T19:34:54.000Z","size":599,"stargazers_count":3,"open_issues_count":14,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T11:12:50.525Z","etag":null,"topics":["branches","cli","git","hacktoberfest","productivity"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmlavoier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-13T15:16:03.000Z","updated_at":"2024-10-02T14:41:46.000Z","dependencies_parsed_at":"2023-02-16T10:40:21.219Z","dependency_job_id":null,"html_url":"https://github.com/jmlavoier/clear-branches","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlavoier%2Fclear-branches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlavoier%2Fclear-branches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlavoier%2Fclear-branches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlavoier%2Fclear-branches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmlavoier","download_url":"https://codeload.github.com/jmlavoier/clear-branches/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235897292,"owners_count":19062685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["branches","cli","git","hacktoberfest","productivity"],"created_at":"2025-01-27T17:53:16.967Z","updated_at":"2025-09-19T06:42:56.474Z","avatar_url":"https://github.com/jmlavoier.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clear-branches\n\nProductive and easy way to clear your local git branches\n\n## Getting started\n\n### Overview\n\nIt's recommended for you who:\n\n- Usually struggle in clearing your local git branches.\n- Anyone that doesn't have the habit of deleting the branches constantly and gets crazy managing a lot of branches.\n- Prefer using a terminal rather than a Git GUI Client.\n\n### Motivation\n\nI implemented this code once ago, as a tiny and ugly script only to help me to be more productive. And I realized that some colleagues were looking for something like this and I've published it to be available to anyone else to use and contribute.\n\n### Requirement\n\nRecommended node version equal to or greater than `v16`\n\n### Quick start\n\nYou don't need to install it globally, if the idea is to use it sometimes, you can just execute it into your git project, so that you will execute the latest stable version.\n\n```shell\n$ npx clear-branches@latest\n```\n\nOr install it on your machine:\n\n**yarn:**\n\n```shell\n$ yarn global add clear-branches\n```\n\n**npm:**\n\n```shell\n$ npm i -g clear-branches\n```\n\n**output**\n\nNow **clear-branches** is executable anywhere you want, if you try into your project you will see the list of branches it will delete and a confirmation message:\n\n```shell\n$ clear-branches\n  feat/component\n  feat/feature\n  fix/functions\n? Are you sure you want to delete listed branches above? › (y/N)\n```\n\n## Advanced options\n\nConsidering a project with these branches:\n\n```\n  feat/component\n  feat/feature\n  fix/functions\n  main\n  release\n```\n\n### clear-branches --force=\\\u003cbranch\u003e[,\\\u003cbranch\u003e]\n\nIt force ignored branches by default to be considered to clear.\n\nBy default, **clear-branches** ignores these branches.\n\n```\n  main\n  master\n  release\n  develop\n```\n\n_\\*The current branch is ignored and is not possible to force delete it_\n\nUsing `clear-branches --force=\u003cbranch\u003e[,\u003cbranch\u003e],` you will be able not to ignore any of these branches.\n\nI.e.:\n\n```shell\n$ clear-branches --force=main\n  feat/component\n  feat/feature\n  fix/functions\n  main  # \u003c-- now main is in the list to deleted\n? Are you sure you want to delete listed branches above? › (y/N)\n```\n\n### clear-branches --ignore=\\\u003cbranch\u003e[,\\\u003cbranch\u003e]\n\nIt ignores the branches you don't want to delete.\n\nI.e.:\n\n```shell\n$ clear-branches --ignores=feat/component,feat/feature\n  fix/functions\n? Are you sure you want to delete listed branches above? › (y/N)\n```\n\n_In this example, `feat/component` and `feat/feature` won't be deleted._\n\n### clear-branches --ignore-pattern=\\\u003cpattern\u003e\n\nIt ignores all branches that match a regex.\n\nI.e.:\n\n```shell\n$ clear-branches --ignores=feat\\/\\\\w+\n  fix/functions\n? Are you sure you want to delete listed branches above? › (y/N)\n```\n\n\\_As both `feat/component` and `feat/feature` match the `feat\\/\\\\w+` regex, they won't be deleted.\n\n\u003e It's needed to escape if you need to use `\\`, like `\\\\w+`\n\n### clear-branches -i, --interactive\n\nWith this option, you can select the branch you want to delete.\n\nI.e.:\n\n```shell\n$ clear-branches -i --force=release,main\n? Choose the branches you want to delete: ›\nInstructions:\n    ↑/↓: Highlight option\n    ←/→/[space]: Toggle selection\n    a: Toggle all\n    enter/return: Complete answer\n◉   feat/component\n◉   feat/feature\n◯   fix/functions\n◯   release\n◯   main\n```\n\nAfter pressing Enter:\n\n```shell\n$ clear-branches -i --force=release,main\n✔ Choose the branches you want to delete: › feat/component, feat/feature\n? Are you sure you want to delete listed branches above? › (y/N)\n```\n\n## Contributing\n\n### Cloning and running\n\n### Testing\n\n### Architecture\n\n### Issues\n\nTo comfortable start contributing to this project, it is encouraged you go for this list of good start issues:\n\n- [Good first issues](https://github.com/jmlavoier/clear-branches/labels/good%20first%20issue)\n\nMore labels\n\n- [Enhancements](https://github.com/jmlavoier/clear-branches/labels/enhancement)\n- [Bugs](https://github.com/jmlavoier/clear-branches/labels/bug)\n\n## Contributors\n\n- https://github.com/jmlavoier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmlavoier%2Fclear-branches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmlavoier%2Fclear-branches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmlavoier%2Fclear-branches/lists"}