How to git ignore subfolders / subdirectories? How to git ignore subfolders / subdirectories? git git

How to git ignore subfolders / subdirectories?


Have you tried wildcards?

Solution/*/bin/DebugSolution/*/bin/Release

With version 1.8.2 of git, you can also use the ** wildcard to match any level of subdirectories:

**/bin/Debug/**/bin/Release/


You can use .gitignore in the top level to ignore all directories in the project with the same name. For example:

Debug/Release/

This should update immediately so it's visible when you do git status. Ensure that these directories are not already added to git, as that will override the ignores.


The question isn't asking about ignoring all subdirectories, but I couldn't find the answer anywhere, so I'll post it: */*.