Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
branchclear-cli
Advanced tools
branchclear-cli 可以快速清理本地、远程、本地和远程已经合并到指定分支(默认为master
)的分支。
安装
npm i -D branchclear-cli
or yarn add branchclear-cli -D
初始化配置
npx branchclear-cli --init
初始化配置,也可使用npx branchclear-cli --init -y
跳过交互生成默认配置。
上述命令将会在项目根目录创建.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
使用
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
配置文件。
参数优先级高于配置文件优先级
当前所在分支不会被删除,主分支不会被删除。正则匹配的分支会/不会被删除
FAQs
git分支清理cli工具
We found that branchclear-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.