【发布时间】:2021-10-02 17:55:04
【问题描述】:
我需要从 git 历史记录中删除许多文档文件,例如 *.html 文件
这些 HTML 文件经过多年的开发,导致 git repo 变得臃肿。现在每次都检查 10 多个 GB 是很困难的。
我能够使用互联网上的脚本找出导致这种膨胀的原因是哪些文件格式,例如
git rev-list --objects --all |
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' |
sed -n 's/^blob //p' |
sort --numeric-sort --key=2 |
cut -c 1-12,41- |
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest**
关于使用 grep 分离文档文件格式。我走到了死胡同。
【问题讨论】:
标签: git git-history