.gitignore doesn't prevent you from committing unwanted files if a pattern is missing. This is a real example: .gitignore had ".sqlite3" extension ignored, but this coworker created a test database as ".dbsq3" or something like that for some reason. He forgot to add the pattern to .gitignore and the file was commited.
Also you can have .env in the .gitignore, yet someone create their file as .env.local and escape the .gitignore pattern. It's easy to come after and lecturing about creating a better .gitignore pattern, but it's even easier to at the very least take a little care of your commits even if it means slower speeds.
Also you can have .env in the .gitignore, yet someone create their file as .env.local and escape the .gitignore pattern. It's easy to come after and lecturing about creating a better .gitignore pattern, but it's even easier to at the very least take a little care of your commits even if it means slower speeds.