This gh extension determines which local branches have been merged and safely deletes them.
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.
gh extension install seachicken/gh-poi
gh poi
Delete the merged local branchesgh poi --state (closed|merged)
Specify the PR state to delete (default merged)gh poi --dry-run
Show branches to delete without actually deleting itgh poi --debug
Enable debug logsgh poi protect <branchname>...
Protect local branches from deletiongh poi unprotect <branchname>...
Unprotect local branches
"poi" means "feel free to throw it away" in Japanese.
If you prefer an alias, you can change it with gh alias set. (e.g. gh alias set clean-branches poi
)