I have a directory structure like this:
.git/ .gitignore main/ ... tools/ ... ...
Inside main and tools, and any other directory, at an
Adding **/bin/ to the .gitignore file did the trick for me (Note: bin folder wasn't added to index).