Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use .gitignore from parent directory to exclude files from search result

I'm using a workspace with 2 different folders that are part of the same reposiory. The .gitignore file for the directories is sitting in the above directory and not inside the folders.

The folder structure:

ParentDir
     .gitIgnore
     folder 1
     folder 2

Because of that VS Code doesn't exclude the files affected from .gitignore

Your help would be apprecited.

like image 420
Noam Yulzari Avatar asked Sep 19 '25 04:09

Noam Yulzari


1 Answers

This was a limitation in VS Code, which has been resolved now that pull request #140022 is merged. Currently you can achieve what you want by enabling the setting Search: Use Parent Ignore Files.

like image 180
Sam Estep Avatar answered Sep 21 '25 19:09

Sam Estep