No need to include target build directory into scm commit. Check them into scm can cause bigger repo size, drive longer time to check out fresh project copy.
Some IDE specific project (.idea directory or *.iml files) configuration might cause problems on other computers, for example file path incompatibility. Following .gitignore is enough for each module.