Supplement · Git Engineering · 13-theory-07-submodule-lfs-worktree

Submodule, LFS và multiple worktrees

Các công cụ này giải dependency pinning, binary storage và checkout concurrency; không thay thế lẫn nhau.

Submodule

Superproject tree lưu gitlink tới exact submodule commit; .gitmodules lưu path/URL metadata. Clone/update phải materialize riêng. Commit được pin phải tồn tại trên submodule remote trước khi superproject tham chiếu. Detached HEAD khi checkout gitlink là bình thường.

Git LFS

Git chứa pointer nhỏ, LFS server chứa binary. Cần quản trị auth, quota, retention, locking và backup của cả Git lẫn LFS. Chuyển history sang LFS rewrite IDs và cần coordination.

Worktree

git worktree cho nhiều working trees dùng chung object database; mỗi worktree có HEAD/index riêng. Một branch thường không checkout ở hai worktree. Prune stale metadata cẩn thận, đặc biệt với removable disks.

gitsubmodules · Git LFS official · git-worktree
← Chương 06Chương 08 →