Git sparse checkout without leading directories
This question already has an answer here:
Checkout subdirectories in Git?
- sparse checkouts in jenkins
- How do I implement sparse checkout in JGit?
- Alternatives to “sparse checkout” in Git
- git checkout . adds directories excluded by sparse checkout
- How can I sparse checkout a subdirectory from git without checking out its parent directories?
- Set Git submodule to shallow clone & 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.