{"id":15508740,"url":"https://github.com/jhoblitt/arborist","last_synced_at":"2025-10-28T01:32:14.761Z","repository":{"id":160016570,"uuid":"634969268","full_name":"jhoblitt/arborist","owner":"jhoblitt","description":"Prune orphaned branches from a forest of repos.","archived":false,"fork":false,"pushed_at":"2024-09-23T17:07:13.000Z","size":589,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T03:12:00.382Z","etag":null,"topics":["git","github","github-actions","github-api","golang","multirepo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhoblitt.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}},"created_at":"2023-05-01T17:05:48.000Z","updated_at":"2024-09-23T17:04:15.000Z","dependencies_parsed_at":"2023-12-19T04:54:49.350Z","dependency_job_id":"0f603d6c-1851-4660-a158-e9dea4cde45a","html_url":"https://github.com/jhoblitt/arborist","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoblitt%2Farborist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoblitt%2Farborist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoblitt%2Farborist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoblitt%2Farborist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhoblitt","download_url":"https://codeload.github.com/jhoblitt/arborist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238579805,"owners_count":19495553,"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":["git","github","github-actions","github-api","golang","multirepo"],"created_at":"2024-10-02T09:39:58.604Z","updated_at":"2025-10-28T01:32:09.456Z","avatar_url":"https://github.com/jhoblitt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arborist\n\n![A Tidy Repo Forest](./images/4193380335_A_lush_forest_of_tall_trees_with_branches_being_cu_xl-beta-v2-2-2.png)\n\nPrune orphaned branches from a forest of repos.\n\n## Synopsys\n\n**Arborist** is intended to prevent orphaned or dead branches from accumulating\nin multi-repo projects. It compares branches across any number of git repos\nhosted on GitHub, although it may also be used to prune branches from a single\nrepo.\n\nBranches with commits \"ahead\" of a repo's \"default branch\" are always\npreserved.  If a branch is even with or behind the \"default branch\", all other\nrepos are inspected for a branch of the same name which is ahead of master. The\nbranch will be preserved if any other repo's matching branch is ahead of its\n\"default branch\", otherwise it is a candidate for removal.\n\n## Installation\n\n### Binary Releases\n\nBinaries are published as [GitHub\nReleases](https://github.com/jhoblitt/arborist/releases).\n\n### Downloading Dangerous Shellcode From the Internet And Executing It\n\n```bash\nmkdir -p ~/bin\ncd ~/bin\n\\curl -sSL https://raw.githubusercontent.com/jhoblitt/arborist/main/install.sh | bash -s\n```\n\n## Usage\n\n```bash\n$ GITHUB_TOKEN=\u003ctoken\u003e arborist\n```\n\n### Complete Example\n\n```bash\n ~/tmp/arborist-test $ cat .arborist.yaml\n---\nnoop: false\nrepos:\n  - repo: jhoblitt/arborist-test1\n    noop: false\n  - repo: jhoblitt/arborist-test2\n    noop: true\nexclude_patterns:\n  - main\n ~/tmp/arborist-test $ export GITHUB_TOKEN=\u003c...\u003e\n ~/tmp/arborist-test $ arborist\njhoblitt/arborist-test1 default branch is: main\njhoblitt/arborist-test2 default branch is: main\njhoblitt/arborist-test1:bar -- ahead: 0, behind: 0\njhoblitt/arborist-test1:baz -- ahead: 0, behind: 0\njhoblitt/arborist-test1:foo -- ahead: 1, behind: 2\nignoring branch: foo because it is ahead\njhoblitt/arborist-test2:bar -- ahead: 0, behind: 0\njhoblitt/arborist-test2:baz -- ahead: 0, behind: 0\njhoblitt/arborist-test2:foo -- ahead: 0, behind: 0\nignoring branch: foo because it is known to be ahead in jhoblitt/arborist-test1\nignoring jhoblitt/arborist-test2:bar as the repo has noop=true\nignoring jhoblitt/arborist-test2:baz as the repo has noop=true\nBranches to be pruned: 2\njhoblitt/arborist-test1:bar -- ahead: 0, behind: 0\ndeleting jhoblitt/arborist-test1:bar\njhoblitt/arborist-test1:baz -- ahead: 0, behind: 0\ndeleting jhoblitt/arborist-test1:baz\n```\n\n### GitHub API Token\n\n`arborist` uses GitHub's API and requires an API token to function. This may be\nprovided by setting the env var `GITHUB_TOKEN` or specified with the\n`--github-token` flag. The env var should generally be preferred as this does\nnot result in a \"secret\" being visible in the host's process table.\n\n### Config File\n\nMost configuration is in the form of a `.arborist.yaml` file. By default, this\nfile is expected to be in the same path from which `arborist` was invoked.  The\nlocation of the configuration file may be overridden with the `--conf` flag.\n\n```bash\nGITHUB_TOKEN=... arborist --conf /foo/bar/baz.yaml\n```\n\nThe config file is in vanilla [`yaml`](https://yaml.org/) format.\n\nExample `.arborist.yaml`:\n\n```\n---\nnoop: true  # default\nrepos:\n  - repo: jhoblitt/arborist-test1\n    noop: false\n  - repo: jhoblitt/arborist-test2\n    noop: true  # default\nexclude_patterns:\n  - main\n```\n\n#### Top Level Config\n\n| Key             | Description|\n| -----           | -----------------------|\n| noop            | A \"master arm switch\" for branch deletion.  When `true` no branches may be deleted.  When `false`, branches in a repo may be deleted but only if the `noop: false` is also set on the repo directly. Defaults to `true`. |\n| repos           | A Sequence (list) of Mappings (hashes) that configure which repo(s) make up the forest in [Repo Config](#repo-config) format. At least one repo must be specified. |\n| exclude_pattern | A Sequence (list) of branch name patterns to ignore. Patterns are [Golang style regular expressions](https://github.com/google/re2/wiki/Syntax). Optional. |\n\n#### Repo Config\n\n| Key   | Description                                                      |\n| ----- | -----------------------                                          |\n| repo  | Name of GitHub repo in `\u003corg\u003e/\u003cname\u003e` format. Required.          |\n| noop  | Branches may be deleted when set to `false`. Defaults to `true`. |\n\n## OCI Image\n\nOCI images are published to [ghcr.io/jhoblitt/arborist](https://github.com/jhoblitt/arborist/pkgs/container/arborist).\n\n### Example `docker run`\n\n```bash\n$ docker run -ti -e GITHUB_TOKEN=$GITHUB_TOKEN -v $(pwd):$(pwd) -w $(pwd) ghcr.io/jhoblitt/arborist:latest\n```\n\n## GitHub Action\n\nA GitHub Action is available to help automatically maintain a healthy forest.\nSee: [`jhoblitt/arborist-action`](https://github.com/jhoblitt/arborist-action)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhoblitt%2Farborist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhoblitt%2Farborist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhoblitt%2Farborist/lists"}