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?
gitignore file is usually placed in the repository's root directory. However, you can create multiple . gitignore files in different subdirectories in your repository.
Have you tried wildcards?
Solution/*/bin/Debug Solution/*/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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With