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 🙏

© 2024 – Pkg Stats / Ryan Hefner

branchclear-cli

v2.2.1

Published

git分支清理cli工具

Downloads

54

Readme

介绍

Commitizen friendly semantic-release

branchclear-cli 可以快速清理本地、远程、本地和远程已经合并到指定分支(默认为master)的分支。

开始使用

  1. 安装 npm i -D branchclear-cli or yarn add branchclear-cli -D

  2. 初始化配置 npx branchclear-cli --init 初始化配置,也可使用npx branchclear-cli --init -y跳过交互生成默认配置。

    npx branchclear-cli --init gif图片

    上述命令将会在项目根目录创建.branchclear.yml文件

    下面为npx branchclear-cli --init -y创建的默认.branchclear.yml文件

    # 只删除正则匹配的分支 正则字符串 isReg必须为true才可设置
    branchRegStr: ''
    # 清除本地、远程、本地和远程分支 local 本地、remote 远程、all 本地和远程
    ÷clearPosition: local
    # 清除分支类型 all 清除所有用户已经合并的分支 current 只删除当前用户已经合并的分支 custom 自定义删除分支的用户
    clearType: current
    # 忽略的分支正则 isIgnore必须为true才可设置
    ignoreRegStr: ''
    # 是否有忽略的分支
    isIgnore: false
    # 是否只删除匹配的分支
    isReg: false
    # 主分支的分支名
    main: master
    # 远程仓库名字
    remoteName: origin
    # 只删除当前帐号创建的分支 默认为git config user.name。注意:只有clearType==='custom'时,才生效
    user: mengshang918
  3. 使用

    • script 脚本使用

      yarn clear或者npm run clear

      {
        "scripts": {
          "clear": "branchclear"
        }
      }
    • 配合 husky

      使用git-push 钩子在代码push前自动删除已经合并到主分支的分支。

      {
        "husky": {
          "hooks": {
            "pre-push": "exec < /dev/tty && branchclear"
          }
        }
      }

清除分支交互 gif

参数

Options:
  -V,--version                         当前版本号
  -y,--yes                             所有选项使用默认值
  --init                               生成.branchclear.json配置文件
  -m, --main <master>                  主分支名称 (default: "master")
  -u,--user <user>                     只删除指定git用户创建的分支 (default: "jiangxiaowei")
  -p,--position <local|remote|all>     删除类型 (default: "local")
  -remote,--remotename <origin>        远程仓库名字 (default: "origin")
  --branchreg <RegExp>                 匹配的分支正则
  --ignorereg <RegExp>                 忽略的分支正则
  -t,--cleartype <all|current|custom>  删除所有用户合并分支|只删除当前用户分支|删除自定义用户分支 (default: "current")
  -h, --help                           display help for command

使用参数前必须先使用--init创建.branchclear.yml配置文件。

参数优先级高于配置文件优先级

提示

当前所在分支不会被删除,主分支不会被删除。正则匹配的分支会/不会被删除

规划

todo