Ninetiger blog

-- my reminder

How to only clone subdirectories from a Git Repository

This is called sparse checkout, since version 1.7.0.


  1. Create an empty repo.
  2. Turn on sparse checkout feature
  3. Edit .git/info/sparse-checkout file to only include the files or folders needed.


mkdir <repo>
cd <repo>
git init
git remote add -f origin <url>


git config core.sparseCheckout true

Then edit .git/info/sparse-checkout, eg:




by dobsonz, 2020年10月18日 9:27:31 PM Iz4UoM levitra nizagara
by dobsonz, 2020年10月18日 9:27:29 PM Iz4UoM levitra nizagara

Back to top