How to commit empty folders to a Mercurial repository?
Asked Answered
H

3

17

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

Hawkie answered 26/1, 2011 at 13:31 Comment(2)
duplicate of: superuser.com/questions/81204/…Hawkie
superuser.com is a duplicate of stackoverflow.com. :)Downcomer
N
18

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

Neath answered 26/1, 2011 at 13:33 Comment(1)
Ruby on Rails suggests the name .keep for such files.Disproportion
N
23

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.

Noctule answered 26/1, 2011 at 13:35 Comment(2)
the purpose of such folders is for interoperation with svn. my svn client requires that .svn\tmp existsHawkie
then probably a readme in the folder explaining that the folder is for svn interop is the way to goNoctule
N
18

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

Neath answered 26/1, 2011 at 13:33 Comment(1)
Ruby on Rails suggests the name .keep for such files.Disproportion
D
0

If you have a project with a build process it should create needed folders automatically when needed.

Downcomer answered 8/12, 2022 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.