Tech News
← Home  ·  All topics

Gitignore

2 GoKawiil briefs on this topic

Git's lesser-known ignore files: .git/info/exclude and global excludes

A developer describes discovering that git supports two additional ignore mechanisms beyond the well-known .gitignore file: a per-clone .git/info/exclude file and a global excludes file set via the core.excludesFile config option. Neither of these files gets committed to the repository, unlike .gitignore, making them suited for personal scratch files and editor or OS clutter respectively. The writer says an AI coding assistant, Claude, prompted the discovery by suggesting untracked personal notes be added to .git/info/exclude.

Developer proposes 'deny by default' .gitignore strategy to stop accidental commits

A developer suggests flipping the typical .gitignore convention: instead of listing files to ignore, developers should block everything with a wildcard and explicitly allow only the file types they want tracked, such as source files, README, and module files. This approach aims to prevent common mistakes like committing .DS_Store files, node_modules, IDE configs, or sensitive environment variables. The post also recommends using 'git check-ignore -v' to debug tracking issues and mentions lazygit as a useful Git terminal tool.