How can I add an empty directory (that contains no files) to a Git repository?
The Ruby on Rails log folder creation way:
mkdir log && touch log/.gitkeep && git add log/.gitkeep
Now the log directory will be included in the tree. It is super-useful when deploying, so you won't have to write a routine to make log directories.
The logfiles can be kept out by issuing,
echo log/dev.log >> .gitignore
but you probably knew that.