Re:Don't create .gitkeep files, use .gitignore instead
by predkambrij on Saturday February 21, 2026 @03:05PM
(#47104144)
I share your view. .keep and .gitignore are different things. Having one .gitignore caputuring everything is less mental load.
Re:Don't create .gitkeep files, use .gitignore instead
by zahlman on Saturday February 21, 2026 @03:13PM
(#47104217)
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.
Re:Don't create .gitkeep files, use .gitignore instead
by beAbU on Sunday February 22, 2026 @05:50AM
(#47110000)
Why not put '.local' in your toplevel gitignore, and not commit an empty .local folder up to the forge?
Re:Don't create .gitkeep files, use .gitignore instead
by zahlman on Sunday February 22, 2026 @01:35PM
(#47113445)
Upstream 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.
Re:Don't create .gitkeep files, use .gitignore instead
by ddek on Sunday February 22, 2026 @01:50PM
(#47113566)
You 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.
Re:Don't create .gitkeep files, use .gitignore instead
by hobofan on Sunday February 22, 2026 @05:31PM
(#47115469)
You 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.
Re:Don't create .gitkeep files, use .gitignore instead
by nickysielicki on Saturday February 21, 2026 @03:26PM
(#47104348)
> Having 100 tiny gitignores makes finding out why something is excluded annoying. Our policy is one root level gitgnore and gitkeeps where required.
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.
Re:Don't create .gitkeep files, use .gitignore instead
by lucketone on Sunday February 22, 2026 @04:59AM
(#47109787)
We could say that practically all problems would work them self out one way or another.
I heard facebook allows any language as long as you have packaged it neatly with all required build chain. (I.e. Even a choice of language works out)
Some lowest common denominator will be reached. (1 :) )
On the other hand: Are we happy with the lowest or do we want to aim higher?
Re:Don't create .gitkeep files, use .gitignore instead
by taftster on Saturday February 21, 2026 @04:20PM
(#47104902)
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.
Some devs will just open the first gitignore they see and throw stuff into it. No thank you.