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