{"id":13819317,"url":"https://github.com/matt-harvey/git_curate","last_synced_at":"2025-05-16T04:33:09.901Z","repository":{"id":50302000,"uuid":"141106489","full_name":"matt-harvey/git_curate","owner":"matt-harvey","description":"✂️ Peruse and delete git branches ergonomically","archived":false,"fork":false,"pushed_at":"2024-08-28T22:26:31.000Z","size":1295,"stargazers_count":430,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-01T22:47:16.333Z","etag":null,"topics":["git","git-extension","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/matt-harvey.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-07-16T08:03:07.000Z","updated_at":"2025-01-18T13:32:46.000Z","dependencies_parsed_at":"2024-01-31T05:08:21.395Z","dependency_job_id":"b5275857-e452-4de0-915c-96089b336a0a","html_url":"https://github.com/matt-harvey/git_curate","commit_stats":{"total_commits":175,"total_committers":1,"mean_commits":175.0,"dds":0.0,"last_synced_commit":"eac3cd22a544dfb9c06ab664b0f95178ce60db97"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-harvey%2Fgit_curate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-harvey%2Fgit_curate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-harvey%2Fgit_curate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-harvey%2Fgit_curate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matt-harvey","download_url":"https://codeload.github.com/matt-harvey/git_curate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254469872,"owners_count":22076563,"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","git-extension","ruby"],"created_at":"2024-08-04T08:00:44.906Z","updated_at":"2025-05-16T04:33:08.607Z","avatar_url":"https://github.com/matt-harvey.png","language":"Ruby","funding_links":[],"categories":["Ruby","Happy Exploring 🤘","命令行工具","Git Tools"],"sub_categories":[],"readme":"# git curate\n\n[![Gem Version][GV img]][Gem Version]\n[![Build Status][BS img]][Build Status]\n[![Coverage Status][CS img]][Coverage Status]\n[![Awesome][AR img]][Awesome Ruby]\n\n\u003cimg src=\"https://raw.githubusercontent.com/matt-harvey/git_curate/master/assets/demo.gif\" width=\"1000\" alt=\"Demo\" /\u003e\n\n## Motivation\n\nAfter a while, my local repo becomes cluttered with branches, and `git branch` outputs an awkwardly\nlong list. I want to delete some of those branches to bring that list back under control; but I\ncan\u0026#8217;t always remember which branches I want to keep from the branch names alone; and inspecting them\none at a time and _then_ running `git branch -D` in a separate step, is painful.\n\n`git curate` is intended to ease this pain. It steps you through the local branches of a repo one at\na time, outputting the following information about each:\n\n* Last commit date\n* Last commit hash\n* Last commit author\n* Last commit subject\n* Whether the branch has been merged into the current HEAD\n* The status of the branch relative to the upstream branch it is tracking (if any)\n\nYou can then select whether to delete or keep each branch as you go.\n\n**NOTE** `git curate` does _not_ run `git fetch` prior to generating its output. If you want to\nbe sure that the \u0026ldquo;Status vs upstream\u0026rdquo; column reflects the latest state of the upstream branches\nas per their remote repository, you should run `git fetch` first.\n\n## Installation\n\nYou\u0026#8217;ll need Ruby (v3.1.0 or greater) installed. Run:\n\n```\ngem install git_curate\n```\n\nto install the executable.\n\nNote `git_curate` uses the [rugged](https://github.com/libgit2/rugged) library, which comes with a\nnative C extension, `libgit2`. Installation via `gem install git_curate` will trigger this extension\nto be compiled; this may take a few minutes, depending on your machine.\n\nIf you receive an error like `ERROR: Failed to build gem native extension`, it\u0026#8217;s probably because\nyour system lacks certain prerequisites needed for building `libgit2`, for example `cmake`. To fix this,\nfirst follow the [installation instructions for rugged](https://github.com/libgit2/rugged#install); then\nrun `gem install git_curate` again.\n\n## Usage\n\nFrom within a git repo, run:\n\n```\ngit curate\n```\n\nThis will step you through your local branches one at a time, outputting some information about\neach, and asking you whether to keep or delete each branch.\n\nAt each branch, enter \u0026ldquo;k\u0026rdquo;\u0026mdash;or simply press Enter\u0026mdash;to _keep_ the branch and move to the next one;\nor enter \u0026ldquo;d\u0026rdquo; to select the branch for deletion.\n\nEntering \u0026ldquo;e\u0026rdquo; will end the session immediately, deleting all selected branches; and \u0026ldquo;a\u0026rdquo; will\nabort the session without deleting any branches. Once the final branch has been considered,\nany selected branches will be immediately deleted.\n\nNote the branch you are currently on will not be included in the list, as `git` does not allow you to delete\nthe branch you\u0026#8217;re on. (The same applies to any branches that are currently checked out in other\n[worktrees](https://git-scm.com/docs/git-worktree).)\n\nIf you just want to view the information about your local branches without stepping through\nthem interactively, enter `git curate --list` or `git curate -l`. Your current branch _will_\nbe included in this list in this case.\n\nYou can also pass `--merged` to see only those branches merged into current `HEAD`; or `--no-merged`\nto see only those branches _not_ merged into current `HEAD`.\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/matt-harvey/git_curate).\n\nTo start working on `git_curate`, `git clone` and `cd` into your fork of the repo, then run `bin/setup` to\ninstall dependencies.\n\nTo run the test suite, run `bundle exec rake spec`. For a list of other Rake tasks, run `bundle exec rake -T`.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n[Gem Version]: https://rubygems.org/gems/git_curate\n[Build Status]: https://github.com/matt-harvey/git_curate/actions/workflows/tests.yml\n[Coverage Status]: https://coveralls.io/github/matt-harvey/git_curate\n[Awesome Ruby]: https://awesome-ruby.com/#-git-tools\n\n[GV img]: https://img.shields.io/gem/v/git_curate.svg\n[BS img]: https://github.com/matt-harvey/git_curate/actions/workflows/tests.yml/badge.svg\n[CS img]: https://img.shields.io/coveralls/matt-harvey/git_curate.svg\n[AR img]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-harvey%2Fgit_curate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatt-harvey%2Fgit_curate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-harvey%2Fgit_curate/lists"}