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.