Git / Mecurial do not track empty directories, but there is a useful tool to help.
To track empty directories, you need to simply create place holder / dummy files in those directories e.g. a simple txt file.
If you have many folders or are importing an existing project into source control it can be a pain to create all the place holder files.
Fortunately there is an easy to use command line tool that will scan through all your directories and generate dummy files for you at the bottom depth. Even better if you directory structure changes and a folder is not longer empty it will delete them for you.
You can download the open source / free tool from the makeemptydirs website