# GIT SPARSE-CHECKOUT 1. `cd ` 1. `git sparse-checkout init` 1. `git sparse-checkout set `, where is pattern like gitignore-pattern 1. Then git will create file at path `YOUR_REPO/.git/info/sparse-checkout` 1. Your might edit this file with `git sparse-checkout set` or IDE, or via cli - `echo !program.ts' > .git/info/sparse-checkout` 1. The logic of `sparse-checkout` file is the opposite of `.gitignore` - in `sparse-checkout` you should set folders that will be ENABLED (in other hand in `.gitignore` you should set folders that will be DISABLED) 1. `sparse-checkout` will be apply ONLY for local repo (in other hand `.gitignore` will be apply to remote repo) # EXAMPLE ``` # enable all files but not program.ts /* !.program.ts ```