DEV Community

Discussion on: 12 Days of Gitmas: .gitignore

Collapse
 
tbroyer profile image
Thomas Broyer

If you are on a Mac, you'd want to add .DS_Store in a global ignore file.

If you allow dev-env specific files in your project's .gitignore, then next time a new Dev comes with a different environment (vscode vs webstorm vs him vs emacs vs whatever, Mac vs Windows, etc.) she'll want to add it there. Your gitignore is going to become an unmanageable mess.

Project gitignore files should only care about project specific rules (it's a JS project, is you're going to ignore node_modules, a Python project will ignore *.pyc files, a Maven one will ignore target directories, etc.)

GitHub's doc on gitignore is doing good in this regard.