git lfs clone
git lfs clone
command operates exactly like git clone
and takes all the same arguments, but has one important difference: it’s a lot faster! Depending on the number of files you have it can be more than 10x faster in fact.git clone
, firstly git downloads the repository objects, which in LFS terms are just pointer data. Once that’s done, the default branch is checked out to create your starting working copy, and the smudge filter is called for any LFS files. This then downloads any content it doesn’t have on demand.git lfs clone
command first calls git clone
, but it disables the LFS smudge filter using Git’s -c
option; like this:checkout
part of the clone operation and files which are tracked in Git LFS are created in the working copy, the smudge filter is not invoked and they are initially written to disk exactly as Git sees them; just pointer files that look something like this:git lfs clone
moves on to the second step, which is to perform the same tasks as git lfs pull
to download and populate your working copy with real LFS content. This is in itself a compound operation which does the following:git lfs fetch
to download the LFS content you need.git lfs checkout
to replace LFS pointer files in your working copy with real content.git lfs clone
, fewer calls are made to the LFS API and multiple files are downloaded in parallel, making this much faster than the per-file smudge approach.git lfs help fetch
and see the “Recent changes” section for more information.