{"id":18053325,"url":"https://github.com/luzifer/clean-github-branches","last_synced_at":"2026-05-05T07:31:23.989Z","repository":{"id":57613829,"uuid":"147803602","full_name":"Luzifer/clean-github-branches","owner":"Luzifer","description":"Tooling to clean up branches in Github repositories","archived":false,"fork":false,"pushed_at":"2018-09-07T10:10:24.000Z","size":1320,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T15:41:10.407Z","etag":null,"topics":["branch","cleanup","github","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Luzifer.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2018-09-07T09:40:11.000Z","updated_at":"2019-07-13T19:35:10.000Z","dependencies_parsed_at":"2022-09-10T23:30:47.365Z","dependency_job_id":null,"html_url":"https://github.com/Luzifer/clean-github-branches","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fclean-github-branches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fclean-github-branches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fclean-github-branches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fclean-github-branches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luzifer","download_url":"https://codeload.github.com/Luzifer/clean-github-branches/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305942,"owners_count":20917208,"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","cleanup","github","golang"],"created_at":"2024-10-30T23:16:49.051Z","updated_at":"2026-05-05T07:31:23.370Z","avatar_url":"https://github.com/Luzifer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/clean-github-branches)](https://goreportcard.com/report/github.com/Luzifer/clean-github-branches)\n![](https://badges.fyi/github/license/Luzifer/clean-github-branches)\n![](https://badges.fyi/github/downloads/Luzifer/clean-github-branches)\n![](https://badges.fyi/github/latest-release/Luzifer/clean-github-branches)\n\n# Luzifer / clean-github-branches\n\nThis tool is intended to clean up branches in repositories having many contributors with several pull-requests: Most of the time people tend to forget to delete the branch after merging the pull-request and branches pile up. Running `clean-github-branches` against the repo will find\n\n- branches whose corresponding pull-requests are merged and delete them\n- branches not being ahead of the base branch and delete them after a configurable duration\n- branches being stale and optionally delete them after a configurable duration\n\n## Usage\n\n```console\n$ clean-github-branches --help\nUsage of clean-github-branches:\n      --branch-staleness duration   When to see a branch as stale (default 90d) (default 2160h0m0s)\n      --delete-stale                Delete branches after branch-staleness even if ahead of base\n  -n, --dry-run                     Do a dry-run (take no destructive action) (default true)\n      --even-timeout duration       When to delete a branch which is not ahead of base (default 24h0m0s)\n      --listen string               Port/IP to listen on (default \":3000\")\n      --log-level string            Log level (debug, info, warn, error, fatal) (default \"info\")\n      --process-limit int           How many repos to process concurrently (default 10)\n  -r, --repo-regex string           Regular expression the full repo (user/reponame) must match against\n      --token string                Token to access Github API\n      --version                     Prints current version and exits\n\n$ clean-github-branches -r '^[lL]uzifer(-docker|-ansible|)/'\nWARN[0012] Stale branch found                            age=2y174d23h ahead=1 behind=1 branch=develop dry-run=true repo=luzifer-docker/etherpad-lite\nINFO[0012] Done.\n```\n\nAll parameters causing destructive actions are set to sane defaults: By default a `dry-run` is done which prevents any deletion. Also `delete-stale` is disabled as it might cause data loss as the branch is not merged and all commits in it will be lost.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fclean-github-branches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluzifer%2Fclean-github-branches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fclean-github-branches/lists"}