vault backup: 2025-12-04 09:12:56

This commit is contained in:
杜鹏飞
2025-12-04 09:12:56 +08:00
commit 71e83861de
300 changed files with 339584 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
- 查看文件大小
```text
du -ah .git/objects
```
- 占用空间最多的五个文件
```text
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5 | awk '{print$1}')"
```
从 git 历史中移除
```text
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch 你的大文件名' --prune-empty --tag-name-filter cat -- --all
```
真正删除
```text
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
git push origin master --force
```