git sparse-checkout
all
Check out only part of a repository's files instead of cloning or checking out everything.
More info →Examples (4)
Enable sparse checkout
Disable sparse-checkout and restore full repository
Specify which directories (or files) to include
git sparse-checkout set path/to/directoryAdd more paths later
git sparse-checkout add path/to/directorymade by @shridhargupta | data from tldr-pages