I'm not sure if I'm the one to blame for this or not, but the earliest reference to ".gitkeep" I can find online is my 2010 answer on Stack Overflow: https://stackoverflow.com/a/4250082/28422
Dummy empty files such as .keepme were used in CVS repositories for exactly the same purpose, and probably other version controls systems long before Git existed.
The Peter Cederqvist manual recommended the practice.
Yeah... I don't think you were wrong. Having 100 tiny gitignores makes finding out why something is excluded annoying. Our policy is one root level gitgnore and gitkeeps where required.
Some devs will just open the first gitignore they see and throw stuff into it. No thank you.
I like to make a .local folder at the top of the project, which contains a .gitignore that ignores everything. Then I can effortlessly stash my development notes there without affecting the project .gitignore or messing around within the .git directory.
I agree with you. Empty .gitignore would be a "smell" to me. Whereas .gitkeep tells me exactly what purpose it serves. I like the semantic difference here that you describe. I don't like when multiple .gitignore files are littered throughout the codebase.
It's especially funny since my answer is wrong anyway! The other top answer is much better. I did get a lot of early SO brownie points from that one answer though.
pilaf|10 days ago
https://github.com/rails/rails/commit/785493ffed41abcca0686b...
kazinator|9 days ago
The Peter Cederqvist manual recommended the practice.
Here is a 1993 dated copy someone left hosted:
https://www.astro.princeton.edu/~rhl/cvs/cvs.html
The paragraph which recommends the .keepme files is:
https://www.astro.princeton.edu/~rhl/cvs/cvs.html#SEC63
"if you want an empty directory then put a dummy file (for example `.keepme') in it to prevent `-P' from removing it."
hn92726819|10 days ago
Some devs will just open the first gitignore they see and throw stuff into it. No thank you.
zahlman|10 days ago
predkambrij|10 days ago
taftster|9 days ago
nickysielicki|10 days ago
This is not a complicated or important enough problem to justify a team-wide policy. Let it work itself out naturally.
https://git-scm.com/docs/git-check-ignore makes it trivial to debug repo-wide gitignore behavior.
selridge|10 days ago
jkubicek|10 days ago