February 20, 2026
Tiny file, huge fight
Don't create .gitkeep files, use .gitignore instead
Developers feuding over tiny hidden files — and the comments are savage
TLDR: The post argues: skip the .gitkeep placeholder and put a .gitignore inside the folder to include it cleanly. Comments split between “you can commit ignored files,” “scripts should make folders,” and “.gitkeep is fine for scaffolding,” proving even tiny files can spark outsized debates—and cleaner repos matter.
Git—the tool that remembers your files—doesn’t remember empty folders. The post’s take: ditch the mysterious .gitkeep placeholder and drop a tiny .gitignore file inside the folder to make it show up, with fewer headaches and no odd exceptions. It’s a clean, standard trick that survives renames. Sounds neat… until the comments lit up and turned a file-naming tip into a mini culture war.
Top reaction: confusion and correction. One reader insisted you can commit an ignored file anyway, so the exclude-then-unexclude dance is theater. Another shrugged, “why not let your build script make the folder?”—a vibe check that undercuts the entire premise. Pragmatists chimed in with real-life messiness: they nuke the folder in cleanup scripts, then bring it back with .gitkeep because it’s, well, handy. Purists pushed back: the author is “misusing” .gitkeep, which they reserve for future code folders, not throwaway build outputs. And the thread’s mood ring? A deliciously deadpan “No, thanks,” the drive-by dismissal that launched a thousand smirks. The jokes wrote themselves: tiny files, big feelings. Team Keep vs Team Ignore traded barbs, but the takeaway for newcomers is simple: both tricks make a folder stick around; the fight is about style, clarity, and who cleans up after.
Key Points
- •Git does not track directories, only files, which complicates keeping empty directories in repositories.
- •A common approach uses an empty .gitkeep file and .gitignore rules to include only that file in the directory.
- •The .gitkeep method works but requires editing two files, breaks on renames without updates, and is not an official Git convention.
- •A simpler method places a .gitignore file inside the directory with patterns to ignore everything except the .gitignore.
- •Committing the directory with its .gitignore cleanly tracks the directory and remains stable across renames.