git add . picks up every stray file in the folder too. When you only want to stage changes to files that are already in the repository, use -u.
git add -u
-u is short for --update. It stages modifications and deletions of tracked files and ignores untracked files completely. So a deleted file gets staged as deleted, an edited one as modified, and that notes.txt you made for yourself stays untracked.
$ git status -s
M a.txt
D old.txt
?? notes.txt
$ git add -u
$ git status -s
M a.txt
D old.txt
?? notes.txt
Without a path it works on the whole repository, even from a subfolder. Give a path to limit it: git add -u src/.
The flip side is that a new file you actually wanted is left out too, and it’s easy to miss. I’d check git status for ?? lines before committing. If you want everything, new files included, git add -A does that, but then your ignore rules better be in order.
Further reading: git-add documentation