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\" folde
All the above answers are valid, but something that I don't think is mentioned is that once you add a file from that directory into the repo, you can't ignore that directory/subdirectory that contains that file (git will ignore that directive).
To ignore already added files run
$ git rm --cached
Otherwise you'll have to remove all files from the repo's target directory first - and then you can ignore that folder.