
Alexander L. answered 04/12/20
Computer Sciences BA Grad and Software Engineer II
Ignore:
- Files/directories that your project does not use
- 90% of the time this is simply code and/or junk output that you forgot to delete
- Operating system files, etc...
- Files/directories that you do not need to be in a shared state (files your team doesn't use)
- Your custom launch settings
- Any custom project settings really
- Credentials
- Files/directories which are generated by your project or another process
- Any files downloaded via a package manager
- Any files generated from your compile and build process
These are just a few specific examples but there are tons more. I think 3 is the most common mistake people tend to make with their source control. As a web developer, I cringe when I see a node_modules folder in a repository full of packages.
From a practical standpoint, there exists a repository that answers your question specific to what you are doing. It provides .gitignore files for a various range of projects: