Supplement · Git Engineering · 12-theory-06-partial-shallow-sparse

Partial clone, shallow clone và sparse checkout

Ba kỹ thuật giảm ba chiều khác nhau: objects, history và working tree.

Shallow

--depth tạo boundary và giả lập commit không có parent. Clone nhẹ hơn nhưng merge-base, blame, describe và push/integration có thể thiếu history; deepen/unshallow khi workflow cần.

Partial

--filter=blob:none giữ commit/tree graph nhưng để blob thiếu và lazy-fetch từ promisor remote. Initial transfer giảm, nhưng build/search toàn repo có thể tạo nhiều round trip; cần server support, cache và offline plan.

Sparse

Sparse checkout giới hạn paths materialized; cone mode tối ưu directory patterns. Sparse index thu gọn index bằng sparse-directory entries, nhưng tool integration phải được test. Sparse không giảm lịch sử hoặc objects nếu không kết hợp partial clone.

Partial clone design · git-clone · git-sparse-checkout · Shallow repository
← Chương 05Chương 07 →