Hacker News
.gitignore Everything by Default
The article proposes a “ignore-everything-by-default” strategy, using a .gitignore that first blocks all files ( * ) and then explicitly unblocks only needed items such as .gitignore, *.go, README.md, go.mod and go.sum for a Go project. This approach prevents accidental commits of unwanted files like .DS_Store, node_modules, IDE configs, or environment variables, and can be verified with git check-ignore -v.