← 返回
未分类 中文

Git Repo Cleaner

Audit and clean up Git repositories. Find stale/merged branches, large files in history, orphaned tags, repo bloat, and generate cleanup scripts. Use when as...
审计并清理 Git 仓库。查找陈旧/已合并的分支、历史中的大文件、孤立标签、仓库膨胀,并生成清理脚本。使用时机...
charlie-morrison charlie-morrison 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 404
下载
💾 1
安装
1
版本
#latest

概述

Git Repo Cleaner

Audit Git repositories for bloat, stale branches, and maintenance issues. Generate safe cleanup scripts.

Quick Audit

python3 scripts/audit_repo.py /path/to/repo

Specific Checks

# Stale branches only
python3 scripts/audit_repo.py /path/to/repo --check branches

# Large files in history
python3 scripts/audit_repo.py /path/to/repo --check large-files

# Full audit
python3 scripts/audit_repo.py /path/to/repo --check all

Output Formats

python3 scripts/audit_repo.py /path/to/repo --format text|json|markdown

Checks Performed

1. Stale Branches

  • Branches not updated in >30 days (configurable with --stale-days)
  • Branches already merged into main/master
  • Branches with no unique commits
  • Remote tracking branches with deleted remotes

2. Large Files

  • Files >1MB in current tree (configurable with --min-size)
  • Large blobs in git history (top 20)
  • Binary files that shouldn't be tracked

3. Repo Stats

  • Total repo size (.git directory)
  • Pack file stats
  • Object count and size
  • Unreachable objects

4. Maintenance

  • Missing .gitignore patterns (node_modules, __pycache__, .env, etc.)
  • Unoptimized packfiles
  • Stale reflog entries

Cleanup Script Generation

Use --fix to generate (not execute) cleanup scripts:

python3 scripts/audit_repo.py /path/to/repo --fix
# Outputs cleanup.sh with safe delete commands

The generated script uses git branch -d (safe delete, refuses if not merged) by default.

Use --force-delete to generate git branch -D commands instead.

Workflow

  1. Run audit on repo
  2. Review findings
  3. Generate cleanup script if needed
  4. Review script before executing
  5. Execute cleanup

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 04:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 197 📥 67,975
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 76 📥 182,486
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,535