Partial clone 用于减少 clone 时下载的 Git 对象。
大仓库中,历史和对象体积可能很大。Partial clone 可以让 Git 先拿必要元数据,blob 等对象按需下载。
git clone --filter=blob:none <url>
常见含义:
--filter=blob:none:先不下载文件内容对象,后续按需获取--filter=tree:0:进一步减少 tree 对象下载,适合更极端的大仓库场景具体支持情况要看 Git 版本和远端服务能力。
git clone --filter=blob:none --sparse <url>
cd repo
git sparse-checkout set services/order