npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-branch-prune

v0.0.1

Published

A cross-platform automated Git branch cleaning and management tool with advanced filtering, scheduling, and safety features. Automatically identifies and removes stale branches based on custom rules, with preview mode, interactive confirmation, and rollba

Readme

git-branch-prune

一个跨平台的自动化 Git 分支清理工具,支持智能过滤、安全删除和计划任务。

npm version

安装

npm install -g git-branch-prune

命令别名:gbp

快速开始

# 预览过期分支(超过 7 天的已合并分支)
gbp --preview --min-age 7

# 交互式清理
gbp --min-age 14 --prefix feature/ bugfix/

# CI 模式(非交互)
gbp --yes --min-age 30

核心选项

  • -P, --preview - 预览模式,不删除
  • -y, --yes - 跳过确认(CI 模式)
  • -a, --min-age <days> - 分支最小天数(默认:7)
  • -p, --prefix <...> - 指定分支前缀
  • -m, --main-branch <name> - 主分支名称(默认:main)
  • -o, --only-merged - 仅清理已合并分支(默认:true)
  • --recover - 恢复已删除分支

配置文件

创建 git-branch-prune.config.yaml

mainBranch: main
branchPrefixes: ["feature/", "bugfix/"]
cleanupRules:
  minAgeDays: 7
  onlyMerged: true
safety:
  interactive: true
  protectedBranches: ["main", "develop"]
logging:
  level: "info"

使用配置运行:

gbp --config git-branch-prune.config.yaml --preview

安全特性

  • 预览模式:先确认再删除
  • 受保护分支:默认不删除 main/develop
  • 删除日志git-branch-prune-deletions.log(支持回滚)
  • 交互确认:可批量或逐个确认

示例

# 安装系统调度器(每天凌晨执行)
gbp --install-scheduler --cron "0 0 * * *" --min-age 7

# 清理所有过期分支(含未合并)
gbp --min-age 30 --not-only-merged

# 恢复删除的分支
gbp --recover

# 生成 HTML 报告
gbp --report --report-format html

许可证

MIT