Supplement · Git Engineering · 09-theory-03-packfiles-gc

Packfiles, reachability và garbage collection

Git nén storage mà không thay object identity; prune chỉ an toàn khi hiểu đầy đủ reachability roots.

Loose và packed objects

Object mới thường loose. Packfile gom objects và delta-compress tương đồng; index ánh xạ object ID tới offset. Delta chain và locality ảnh hưởng CPU/IO. Không xóa file trong .git/objects thủ công.

GC lifecycle

git gc/git maintenance pack refs/objects và dọn dữ liệu theo expiry. Refs, reflogs, index và một số temporary roots giữ objects reachable. git prune --expire now có thể phá recovery window và nguy hiểm với writer đồng thời.

Acceleration structures

Commit-graph lưu topology, generation numbers và optional changed-path Bloom filters. Bitmap tăng tốc reachability/pack selection. Multi-pack-index tra object trên nhiều pack và hỗ trợ incremental repack. Tất cả cần refresh theo workload.

Pack format · git-gc · commit-graph · multi-pack-index
← Chương 02Chương 04 →