

You will now have files "checked out" for some/dir and another/sub/tree on your file system (with those paths still), and no other paths present.
#Git sparse checkout update
Last but not least, update your empty repo with the state from the remote: git pull origin master git/info/sparse-checkoutĮcho "another/sub/tree" >. git/info/sparse-checkout, eg: echo "some/dir/" >. Now you need to define which files/folders you want to actually check out. Then do: git config core.sparseCheckout true This creates an empty repository with your remote, and fetches all objects but doesn’t check them out. The steps to do a sparse clone are as follows: mkdir What you are trying to do is called a sparse checkout, and that feature was added in git 1.7.0 (Feb. You can glue them back together using Git Submodules. In general, the consensus in the Git community is that if you have several directories that are always checked out independently, then these are really two different projects and should live in two different repositories. If you are interested, search for discussions on “sparse clone” and “sparse fetch” on the git mailinglist. Implementing something like this in Git would be a substantial effort and it would mean that the integrity of the clientside repository could no longer be guaranteed. (OTOH, since they don’t use the Git server, they could implement it faster in their own implementations before it shows up in Git server.)

GitHub, don’t actually use the Git server, they use their own implementation, so even if support shows up in the Git server, it does not automatically mean that it works on Git hosters.

Note: in Git 2.19, only client-side support is implemented, server-side support is still missing, so it only works when cloning local repositories. EDIT: As of Git 2.19, this is finally possible, as can be seen in this answer.
