Jannie Theunissen
Jannie Theunissen

Reputation: 30154

Is there a .gitkeep equivalent for Mercurial?

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

Answers (3)

John Jefferies
John Jefferies

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

John Zwinck
John Zwinck

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

NoDataFound
NoDataFound

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

Related Questions