Marcel Marcel - 1 year ago 162
Git Question

Git ignore sub folders

I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein.

.gitignore with "bin/" ignores "Debug" and "Release" folders, but also any dll's contained in the "bin" folder.

"bin/Debug" or "bin/Release" in the .gitignore file does not exclude the directories, unless I fully qualify the ignore pattern as "Solution/Project/bin/Debug" - which I don't want to do as I will need to include this full pattern for each project in my solution, as well as add it for any new projects added.

Any suggestions?

Answer Source

Have you tried wildcards?


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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download