Git sparse checkout without leading directories

This question already has an answer here:

  • Checkout subdirectories in Git?

    6 answers

  • Why do excluded files keep reappearing in my git sparse checkout?
  • Git pull contents of a folder from a repository
  • git move portion of old repository to a new repository
  • How to git reset --hard a subdirectory?
  • Sparse checkout in Git 1.7.0?
  • Tips and tricks useful to “checkout” (download) the Android source code more quickly
  • How can I sparse checkout a subdirectory from git without checking out its parent directories?
  • Mercurial sparse checkout
  • 2 Solutions collect form web for “Git sparse checkout without leading directories”

    Some tools like git hub have the ability to view a given folder directly. However to operate on only one folder at a time is forbidden in git as the whole repository must be present to perform the hash of the new commit and make the diff for the commit

    It is also discussed here How to git-pull all but one folder

    The short answer is no. Git sees all files as a single unit. You’d still need to clone the whole repository, which will have all the files.

    Git Baby is a git and github fan, let's start git clone.