Files
cheatsheet-tldr/tldr/git-sparse-checkout
2025-10-08 00:19:16 +00:00

26 lines
590 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git sparse-checkout
> Check out only part of a repositorys files instead of cloning or checking out everything.
> More information: <https://manned.org/git-sparse-checkout>.
- Enable sparse checkout:
`git sparse-checkout init`
- Disable sparse-checkout and restore full repository:
`git sparse-checkout disable`
- Specify which directories (or files) to include:
`git sparse-checkout set {{path/to/directory}}`
- Add more paths later:
`git sparse-checkout add {{path/to/directory}}`