cd <YOUR_REPO>git sparse-checkout initgit 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 setor IDE, or via cli -echo !program.ts' > .git/info/sparse-checkout - The logic of
sparse-checkoutfile is the opposite of.gitignore- insparse-checkoutyou should set folders that will be ENABLED (in other hand in.gitignoreyou should set folders that will be DISABLED) sparse-checkoutwill be apply ONLY for local repo (in other hand.gitignorewill be apply to remote repo)
# enable all files but not program.ts
/*
!.program.ts