5 ms·
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://st
by jkubicek 8mo ago
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 https://stackoverflow.com/a/4250082/28422
If this is all my fault, I'm sorry.
- selridge 8mo agoThis is delightful. Accidental load-bearing SO post.
- pilaf 8mo agoThis Rails commit from May 2010 mentions gitkeeps and it's a few months older than your SO post, so it seems you're absolved from guilt: https://github.com/rails/rails/commit/785493ffed41abcca0686bf05b0a0157e0844d47 https://github.com/rails/rails/commit/785493ffed41abcca0686b...
- hn92726819 8mo agoYeah... 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.
- predkambrij 8mo agoI share your view. .keep and .gitignore are different things. Having one .gitignore caputuring everything is less mental load.
- zahlman 8mo agoI 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.
- beAbU 8mo agoWhy not put '.local' in your toplevel gitignore, and not commit an empty .local folder up to the forge?
- zahlman 8mo agoUpstream never sees an empty .local folder because, as established, Git doesn't keep empty folders. This way, .local isn't mentioned in the top-level .gitignore. It's just that tiny bit cleaner.
- ddek 8mo agoYou can create a global gitignore in your home directory. I have ‘.<myname>’ ignored there, so if I ever create a directory with that name I know it’s contents won’t go into source control. That way I don’t have to edit the repositories gitignore with me-specific stuff.
- hobofan 8mo agoYou wouldn't have to edit the actual repositories gitignore anyways. Every checkout of a repo comes with a .git/info/exclude file, which acts like a local additional gitignore file.
- nickysielicki 8mo ago
- kazinator 8mo agoDummy 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. Here is a 1993 dated copy someone left hosted: https://www.astro.princeton.edu/~rhl/cvs/cvs.html 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 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."