Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seachicken/gh-poi
✨ Safely clean up your local branches
https://github.com/seachicken/gh-poi
cli gh-extension hacktoberfest
Last synced: about 1 month ago
JSON representation
✨ Safely clean up your local branches
- Host: GitHub
- URL: https://github.com/seachicken/gh-poi
- Owner: seachicken
- License: mit
- Created: 2021-09-30T19:59:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-03T09:01:02.000Z (about 1 month ago)
- Last Synced: 2024-11-03T09:20:39.052Z (about 1 month ago)
- Topics: cli, gh-extension, hacktoberfest
- Language: Go
- Homepage: https://dev.to/seachicken/safely-clean-up-your-local-branches-9i3
- Size: 200 KB
- Stars: 670
- Watchers: 3
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gh-cli-extensions - **poi** - Safely clean up your local branches. (Git)
- jimsghstars - seachicken/gh-poi - ✨ Safely clean up your local branches (Go)
README
![logo_readme](https://user-images.githubusercontent.com/5178598/152155497-c06799b7-a95a-44e5-a8a0-a0a9c96ce646.png)
[![CI](https://github.com/seachicken/gh-poi/actions/workflows/ci.yml/badge.svg)](https://github.com/seachicken/gh-poi/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/seachicken/gh-poi/branch/main/graph/badge.svg?token=tcPxPgst2q)](https://codecov.io/gh/seachicken/gh-poi)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6380/badge)](https://bestpractices.coreinfrastructure.org/projects/6380)This [gh](https://github.com/cli/cli) extension determines which local branches have been merged and safely deletes them.
![demo](https://user-images.githubusercontent.com/5178598/140624593-bf38ded3-388b-4a4b-a5c0-4053f8de51ad.gif)
## Motivation
Daily development makes it difficult to know which branch is active when there are many unnecessary branches left locally, which causes a small amount of stress. If you squash merge a pull request, there is no history of the merge to the default branch, so you have to force delete the branch to clean it up, and you have to be careful not to accidentally delete the active branch.
We have made it possible to automatically determine which branches have been merged and clean up the local environment without worry.
## Installation
```
gh extension install seachicken/gh-poi
```## Usage
- `gh poi` Delete the merged local branches
- `gh poi --dry-run` You can check the branch to be deleted without actually deleting it
- `gh poi --debug` Enable debug logs
- `gh poi protect ...` Protect local branches from deletion
- `gh poi unprotect ...` Unprotect local branches## FAQ
### Why the name "poi"?
"poi" means "feel free to throw it away" in Japanese.
If you prefer an alias, you can change it with [gh alias set](https://cli.github.com/manual/gh_alias_set). (e.g. `gh alias set clean-branches poi`)