Add an empty folder with GIT

Hello,
I want to know how to keep an empty folder with git.
Many people used the trick of adding an empty file (eg .gitkeep) in this folder.

But would like to know if there is a way to do it without adding a file in that folder, but simply add path folder to in a configuration file (a bit like the file .gitignore).

Thank you

It seems it’s not possible by design http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository

Why do you want it?

So the only hack is to add an empty file (.gitkeep or other) in the folder

In some cases it is interesting to do, for example in a branch where the software is stable, we can offer people to download the software directly via the branch and therefore the application can run, you have these folders (cache, temporary, …) is present.

As far as I know, usually those types of functions create the folders required if they’re not there.