This is always a pain…you are starting up a new project, you initialized your repo. As you are about to run the command:

you realized some of these files shouldn’t be tracked! What do you do? Head over to the “gitignore” repo on github. A repo for starter .gitignore files for various languages.

https://github.com/github/gitignore

As a side note, git has a global configuration to apply the rules of one .gitignore file to all of your projects on the machine: