| 用途 | 统计各 blob 体积并找出占用大户 |
|---|---|
| 工具组合 | rev-list --objects --all + cat-file --batch-check |
| 后续 | filter-repo 清理或迁移 LFS |
统计脚本(bash)
统计脚本(bash)
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| awk '$1 == "blob" {print $3, $4}' \
| sort -nr | head -30输出包含路径(%(rest)),可直接看出是哪个目录的历史文件;删除前先确认是否仍被引用。