.gitignore is good for stuff that will always be there, but is less good for small one-off files and other detritus.
But if your happy maintaining .gitignore correctly, git add . before commit and youll never miss a file again. You may accidentally commit a secrets file, but thats a different problem for a different day.