Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to commit empty folders to a Mercurial repository?

I noticed that TortoiseHg doesn't commit empty folders. How to fix that?

like image 592
Jader Dias Avatar asked Jan 26 '11 13:01

Jader Dias


2 Answers

Mercurial doesn't track empty folders.

If you really want an 'empty' folder in the repo, I'd suggest checking in a readme file in that folder explaining why it's empty/necessary to be in the repo, that way you can have a psuedo empty folder and have documentation for why at the same time.

Alternatively look at why you need this folder. Is it for you build process? Then maybe creating it should be part of the build process not version control.

like image 118
jk. Avatar answered Sep 26 '22 03:09

jk.


This is usually done by adding a hidden file in the folder (starting with a dot, like .hidden).

like image 36
Sébastien Le Callonnec Avatar answered Sep 27 '22 03:09

Sébastien Le Callonnec