Blobless clone
git clone --filter=blob:none <url>
creates a blobless clone. These clones download all reachable commits and trees while fetching blobs on-demand. These clones are best for developers and build environments that span multiple builds.
Blobs are downloaded on demand when you do a git checkout
. This includes the first checkout inside the git clone
operation.
blobless clones can perform commands like git merge-base
, git log
, or even git log -- <path>
with the same performance as a full clone.
Commands like git diff
or git blame <path>
require the contents of the paths to compute diffs, so these will trigger blob downloads the first time they are run. However, the good news is that after that you will have those blobs in your repository and do not need to download them a second time. Most developers only need to run git blame
on a small number of files, so this tradeoff of a slightly slower git blame
command is worth the faster clone and fetch times.
On the other hand, git log -p
without a path constraint is risky and could fetch all the blobs in history.