How to commit properly
Commit all files in the working tree that have been modified
git commit -am 'commit message'
Commit a file individually
git commit filename -m 'commit message'
How not to commit
Only commit changes staged in the index, not all modified files
git commit -m 'commit message'