For Nested Folders, I came up with a solution based on Matiss's answer.
Let's say I want to ignore everything in build/
directory (which is in /app
). So I do:
build/*
However, if I want to exclude build/outputs/bundle/release
subfolder, I need to play some hide and seek!
/app/build/*!/app/build/outputs/app/build/outputs/*!/app/build/outputs/bundle/app/build/outputs/bundle/*!/app/build/outputs/bundle/release
Important Notes:
- All the paths should start with
/
and be relative to the.gitignore
- You have to do it one subfolder at a time. You can see in VS Code (for instance) what it includes and what not at every step.