Agreed, and these comments fail to remember you sometimes need code changes to debug. Its nice to stage/unstage code changes, and gitignore won't help u there
Exactly. 'git add' forces you to locally review which code changes you actually need, and catch any debug code, attempted fixes, a bit of whitespace you typed while thinking, refactorings that didn't actually turn out to help etc... . Otherwise it's up to the reviewer to spot.