Git’s Magic Files Are Quietly Running Your Repo — Pay Attention

What they are
It has been reported that a follow-up post on extending git functionality calls out a small set of committed files that subtly shape how git treats your code. These aren’t the config files living in .git/ — they travel with the repository. Think of them as the repo’s house rules: they control what gets tracked, how diffs and merges behave, which large assets go to LFS, and even how GitHub counts your lines of code.
Key examples
.gitignore controls what git should never track (node_modules/, *.log, .env, dist/, and so on), but beware: it only affects untracked files — tracked files stay unless you git rm --cached them. Git also consults .git/info/exclude and a global core.excludesFile (useful for .DS_Store and other OS cruft). .gitattributes lets you set filters, diff drivers, merge strategies and line-ending normalization; it’s also where GitHub Linguist reads linguist-vendored, linguist-generated and linguist-documentation hints. .lfsconfig commits Git LFS settings like the LFS endpoint and retry behavior so teams don’t have to hand-hold their tooling, and if you move files into LFS after the fact you’ll need git lfs migrate. .gitmodules, of course, records submodule configuration so nested repos behave predictably.
Why this matters
Want to build a tool that works with git repos? Respect these files. Ignore them and you’ll break assumptions, ship big binaries, or be surprised by merge behavior — and nobody likes that sinking feeling when a 200MB PSD shows up in master. These magic files are simple, powerful, and underused as a coordination mechanism; they’re the small governance layer that keeps projects tidy across collaborators, CI systems, and web forges. Read them, honor them, and your repo will thank you — or at least stop yelling at you in the next merge conflict.
Sources: nesbitt.io, Lobsters
Comments