DEV Community

Discussion on: .gitignore mistake that everyone makes

Collapse
 
190245 profile image
Dave • Edited

If you want to treat it as a whitelist - which in my view you shouldn't, but hey, who am I to judge... you should probably see the pattern format in the documentation.

A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.

So you could, if you wished: !somedir/**