logoalt Hacker News

macotetoday at 1:07 AM2 repliesview on HN

The author is misusing .gitkeep. I use it to keep source code folders that don’t contain any code yet, but whose structure is already defined.


Replies

xyzzy_plughtoday at 1:18 AM

Truly, what purpose does this serve? Defining a hierarchy without using is injecting immediate debt. Just introduce it when stuff goes there! If you really insist then at least put something in the folder. It doesn't take much effort to make the change at least a tiny bit meaningful.

Better yet just do the work. If you want make a commit in a branch that's destined to be squashed or something, sure, but keep it away from the shared history and certainly remove it when it's not needed anymore.

show 2 replies
CGamesPlaytoday at 4:07 AM

You can rename `.gitkeep` to `.gitignore` and both be happy in that case.