{"id":51118945,"url":"https://github.com/sulthonzh/branchcleanup","last_synced_at":"2026-06-25T00:30:34.075Z","repository":{"id":360924974,"uuid":"1251737928","full_name":"sulthonzh/branchcleanup","owner":"sulthonzh","description":"Smart Git branch cleanup CLI that detects squash-merged branches with interactive deletion","archived":false,"fork":false,"pushed_at":"2026-06-20T11:07:06.000Z","size":135,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T13:08:18.617Z","etag":null,"topics":["branch","cleanup","cli","developer-tools","git","github","merge","squash"],"latest_commit_sha":null,"homepage":null,"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/sulthonzh.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-27T21:42:20.000Z","updated_at":"2026-06-20T11:07:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sulthonzh/branchcleanup","commit_stats":null,"previous_names":["sulthonzh/branchcleanup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sulthonzh/branchcleanup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fbranchcleanup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fbranchcleanup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fbranchcleanup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fbranchcleanup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sulthonzh","download_url":"https://codeload.github.com/sulthonzh/branchcleanup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fbranchcleanup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34755061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["branch","cleanup","cli","developer-tools","git","github","merge","squash"],"created_at":"2026-06-25T00:30:34.005Z","updated_at":"2026-06-25T00:30:34.063Z","avatar_url":"https://github.com/sulthonzh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Branch Cleanup\n\nSmart Git branch cleanup CLI that detects squash-merged branches with interactive deletion.\n\n## Features\n\n- 🔍 **Detects all types of merged branches**: Regular merged + squash-merged (GitHub's default)\n- 🎯 **Interactive deletion**: Safe confirmation prompts for each branch\n- 🛡️ **Safety checks**: Protected branch detection and dry-run mode\n- 📊 **Clear status display**: Shows branch type and safety status\n- ⚡ **Fast and lightweight**: Minimal dependencies, focused on core functionality\n\n## Installation\n\n```bash\nnpm install -g branchcleanup\n```\n\n## Usage\n\n### List branches\n\n```bash\n# List all branches with their status\nbranchcleanup list\n\n# List with custom stale threshold (60 days)\nbranchcleanup list --stale-threshold=60\n\n# Include remote branches in the list\nbranchcleanup list --include-remote\n```\n\n### Interactive cleanup\n\n```bash\n# Interactive cleanup with confirmation prompts\nbranchcleanup cleanup\n\n# Dry run - show what would be deleted\nbranchcleanup cleanup --dry-run\n\n# Force delete (bypass confirmation)\nbranchcleanup cleanup --force\n\n# Include remote branches in cleanup\nbranchcleanup cleanup --include-remote\n```\n\n### Options\n\n```bash\n# Show help\nbranchcleanup --help\n\n# Show version\nbranchcleanup --version\n```\n\n## Examples\n\n### List branches\n\n```\n$ branchcleanup list\n┌─────────────────────┬──────────────┬──────────────┐\n│ Branch              │ Type         │ Safe to Delete│\n├─────────────────────┼──────────────┼──────────────┤\n│ feature/user-auth  │ squash-merged│ ✅ Yes       │\n│ bugfix/login-page   │ merged       │ ✅ Yes       │\n│ experiment/new-ui   │ stale-30d    │ ❌ No (old)   │\n└─────────────────────┴──────────────┴──────────────┘\n```\n\n### Interactive cleanup\n\n```\n$ branchcleanup cleanup\n❓ Delete feature/user-auth (squash-merged)? [y/N] y\n✅ Deleted feature/user-auth\n❓ Delete bugfix/login-page (merged)? [y/N] y  \n✅ Deleted bugfix/login-page\n❓ Delete experiment/new-ui ( stale-30d)? [y/N] n\n📝 Skipping experiment/new-ui (user declined)\n```\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/sulthonzh/branchcleanup.git\ncd branchcleanup\n\n# Install dependencies\nnpm install\n\n# Run in development mode\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Run tests\nnpm test\n\n# Run linting\nnpm run lint\n```\n\n## How It Works\n\n### Branch Detection\n\nThe tool detects three types of branches:\n\n1. **Merged branches**: Detected using `git branch --merged`\n2. **Squash-merged branches**: Detected by checking if all commits from the branch exist in the target branch\n3. **Stale branches**: Branches not touched in the specified number of days (default: 30)\n\n### Remote Branch Support\n\nWith the `--include-remote` flag, the tool can also detect and clean up remote branches:\n\n- **Remote merged branches**: Branches merged on the remote repository\n- **Remote stale branches**: Remote branches not updated within the threshold\n- **Safe deletion**: Remote branches are pushed to `--delete` on their respective remotes\n\n### Safety Features\n\n- **Protected branch detection**: Never deletes `main`, `master`, or other protected branches\n- **Confirmation prompts**: Interactive confirmation for each deletion\n- **Dry-run mode**: Preview what would be deleted without actually deleting\n- **Force mode**: Bypass confirmation for bulk operations\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fbranchcleanup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsulthonzh%2Fbranchcleanup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fbranchcleanup/lists"}