README - Checkout subtree of a Git subdirectory
See also: https://unix.stackexchange.com/questions/233327/is-it-possible-to-clone-only-part-of-a-git-project
Clone with a specific history depth (--depth
) and start at the root of the repository (--sparse
).
You can also filter-out BLOB files. For example:
git clone --sparse --depth 1 --filter blob:none --branch master https://github.com/NowhereLand/helloworld
Change directory into the newly-cloned repository and enable sparse-checkout mechanism (to fetch parts of the subtree in steps of increasing depth)