There's a question asking how to make Git track empty folders.
This answer suggested a way: creating a file called .gitkeep
. It was posted in 2011. In the comments there was much debate whether this name was appropriate; in particular, a comment upvoted more than 200 times said it isn't.
Then, one month ago (that is 11 years later), an edit by another user changed the suggested name to .keep
.
I strongly disagree with this edit (or at least with the name change; they also added a few more lines that I find good). This is an answer with 1041 upvotes and 35 downvotes, and I think the specific name that it proposes is key to that. I would restore the original proposal... And yet, I see the answer's author is still active, though not much (a couple of posts per year). And they were online after that edit, but they didn't object to it.
In my opinion there are so many votes, cast in so many years, that even if in the meanwhile the author has changed their mind, the original file name should be restored. But before doing it I'd like to hear what the community thinks.
.gitkeep
used. Besides, the edit invalidates most of the discussion below it... Edits are not meant to enforce one's opinion, so I'm reverting that rename. Also,.gitkeep
is a name that actually has search results, should one want to figure out what it does..gitkeep
really deliberate? Would changing to something else be against their preferences, or was it just something they happened to go with 11 years ago? If the latter, and if SMEs think it's an unambiguously unfortunate choice, I'd support editing the answer to: "Create an empty file that starts with a.
, such as.keep
or.gitkeep
. This way, <...>" with a bit of elaboration, including the good points in the comments..gitignore
with two lines:*
and!.gitignore
(which happens to be the top answer).