{"id":19362691,"url":"https://github.com/svandriel/remove-merged-branches","last_synced_at":"2026-01-06T22:18:30.139Z","repository":{"id":63324547,"uuid":"566464572","full_name":"svandriel/remove-merged-branches","owner":"svandriel","description":"Removes merged git branches","archived":false,"fork":false,"pushed_at":"2024-09-25T19:33:49.000Z","size":1025,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-11T14:54:54.904Z","etag":null,"topics":["branch","git","merged","remove"],"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/svandriel.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":"2022-11-15T18:21:20.000Z","updated_at":"2022-11-15T23:34:58.000Z","dependencies_parsed_at":"2022-11-17T02:00:32.901Z","dependency_job_id":null,"html_url":"https://github.com/svandriel/remove-merged-branches","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fremove-merged-branches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fremove-merged-branches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fremove-merged-branches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fremove-merged-branches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svandriel","download_url":"https://codeload.github.com/svandriel/remove-merged-branches/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232781423,"owners_count":18575689,"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":["branch","git","merged","remove"],"created_at":"2024-11-10T07:29:55.635Z","updated_at":"2026-01-06T22:18:30.098Z","avatar_url":"https://github.com/svandriel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remove-merged-branches\n\n[![Node.js CI](https://github.com/svandriel/remove-merged-branches/actions/workflows/node.js.yml/badge.svg?branch=master)](https://github.com/svandriel/remove-merged-branches/actions/workflows/node.js.yml)\n\n![Version](https://img.shields.io/github/package-json/v/svandriel/remove-merged-branches?color=%2300d000\u0026label=Latest%20version\u0026style=plastic)\n\nCommand line tool removing all branches that have been merged to the current branch.\n\nSupports dry runs and offline use.\n\nIt can be used to remove both _local_ and _remote_ branches.\n\n## Usage\n\nInstall globally:\n\n```\nnpm i -g remove-merged-branches\n```\n\nAnd then you just call:\n\n```\nrmb\n```\n\n...or if you prefer verbosity, enter `remove-merged-branches`\n\n## Syntax\n\n```\nUsage: rmb [options]\n\nRemoves merged branches locally and remotely\n\nOptions:\n  -V, --version          output the version number\n  -b, --branch \u003cbranch\u003e  Base branch to compare others to (default: \"HEAD\")\n  -o, --offline          Runs without doing anything to remotes (default: false)\n  --verbose              Shows more output (default: false)\n  --dry-run              Performs a dry run instead of removing branches (default: false)\n  -h, --help             output usage information\n```\n\n## What does it do?\n\nFirst it clears out the local branches that have been removed on the remotes:\n\n```bash\ngit fetch --prune\n```\n\nThen, it finds all **local** branches merged to the HEAD branch and removes them:\n\n```bash\ngit branch --merged $(git rev-parse HEAD)\n# Then calls 'git branch -d' on each merged branch\n```\n\nThen, it finds all **remote** branches merged to the HEAD branch and removes them:\n\n```bash\ngit branch --remote --merged $(git rev-parse HEAD)\n# Then call 'git push --no-verify --delete' on each origin and branch\n```\n\nFinally, it clears out the local branches that have been removed due to the previous action:\n\n```bash\ngit fetch --prune\n```\n\n## Example output\n\n```\nINFO Pruning branches removed on remotes\nINFO Removing local branch feature/add-badges-to-markdown, feature/add-more-time-logs, feature/change-ci, feature/refactor-ssh-exec-cmd, refactor/extract-remove-undefineds\nINFO No remote merged branches to HEAD found\nINFO Pruning branches removed on remotes\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvandriel%2Fremove-merged-branches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvandriel%2Fremove-merged-branches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvandriel%2Fremove-merged-branches/lists"}