Reputation: 30154
What is the preferred way to keep empty folders included in the working tree that is under hg management? I have never seen a Mercurial repo with .hgkeep files in them.
Upvotes: 1
Views: 635
Reputation: 1216
Neither git nor hg track folders, only files. So if you require an 'empty' folder to be present you have to track a file within it, as it were. The file would otherwise be ignored by you, and can be called anything you like.
Upvotes: 2
Reputation: 249093
.gitkeep
is not a special name to Git. It's just a convention. You could use .gitkeep
as the placeholder filename in Mercurial too if you wanted! Myself, I use README files and inside I write a note explaining why the directory needs to be checked in if it's empty.
Upvotes: 2
Reputation: 11949
But in git, you simply add any empty file which make git reference the folder.
I would rather use .keep
than .gitkeep
, and so I'd say the same should apply to Mercurial ?
Upvotes: 5