Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szhu/github-prune
GitHub-centralized Git: A simple command that removes local branches that correspond to a closed or merged PR.
https://github.com/szhu/github-prune
Last synced: about 1 month ago
JSON representation
GitHub-centralized Git: A simple command that removes local branches that correspond to a closed or merged PR.
- Host: GitHub
- URL: https://github.com/szhu/github-prune
- Owner: szhu
- Created: 2019-06-11T18:17:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-17T22:15:03.000Z (almost 3 years ago)
- Last Synced: 2024-04-11T15:52:50.594Z (9 months ago)
- Language: TypeScript
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github-prune
Do you have many local Git branches, but most of them are super old?
**github-prune** quickly and safely deletes branches you don't need anymore!
## Purpose
Specifically, this tool will delete all local branches:
- Whose latest commit has been pushed to a PR, and
- Whose latest commit doesn't exist in a remote branch.After running this tool, all remaining branches should be either branches that
have unpushed work or branches that you're still working on.## Installing
**Step 1:**\
Install [Deno](https://deno.land). (On macOS: `brew install deno`)**Step 2:**\
`deno install -f --allow-run --name github-prune https://github.com/szhu/github-prune/raw/master/lib/main.ts`## Using
In your terminal, `cd` into the repo you want to clean up, then run
~/.deno/bin/github-prune
This tool will print out an description of what it does and asks you to confirm
before it does anything.Advanced: Add `~/.deno/bin` to your `PATH` and you can run this as `github-prune`!
## Contributing
It's easy to set up this tool for development as well. Here's how to get up and
running:1. Install [Deno](https://deno.land). (On macOS: `brew install deno`)
2. Clone this repo. Let's say you cloned it to `/path/to/github-prune`.
3. `cd` into the repo that you want to test this tool on.
4. Run: `deno --allow-run /path/to/github-prune/lib/main.ts`