So I see Git doesn\'t recognize folders, or should I say when the only change between commits is addition of empty folders to the working tree they\'re not show in git
I usually put empty .gitkeep in those folders.
You are absolutely correct. Git, like some other version control systems, does not take cognizance of empty folders or of properties of folders. Folders only exist insofar as there are file that are in them. If you want to simulate this, you need to drop placeholder files into them.
I faced this problem when trying to use git as a backup tool with support for deduplication and compression.
My solution was to create my own system. It's available on http://github.com/meingbg/store
Again, my purpose was to store files, not work with code.
Either put empty placeholder files into the folders you want git to keep track of or add instructions to create these folders to your build system if possible.
I usually put a .gitignore
in those directories as you likely want to ignore any runtime generated data anyway.
You should realize that you are asking for your source control system to set up some resources that are not source, not part of your build system, but essential to the operation of your application. I would do one of the following:
Similarly, if the application wanted to append to a log file, it wouldn't make sense to have that logfile start out in the revision control system, would it?