DEV Community

Discussion on: .gitignore mistake that everyone makes

Collapse
 
bloodgain profile image
Cliff • Edited

Your example is still a blacklist with exceptions to broad rules, not a whitelist. A whitelist would block everything that's not explicitly allowed. And a true whitelist would authorize files individually.

That idea feels a bit too much like ClearCase to me. I do agree with your thinking on ignoring all hidden files by default, though. They should only be added explicitly. As for special files for editors and other tools used by individual devs (instead of team tools), developers should really get better about using their global git config and global excludes (gitignore). I also pay attention to things like swap/backup files and configure my editor (Vim, mostly) to not create those files alongside the originals, but in a private directory instead (e.g. ~/.vim/backup, ~/.vim/swap)