You can clone with
# Recursively add a .gitignore file to all directories
# in the working directory which are empty and don't
# start with a dot. Helpful for tracking empty dirs
# in a git repository.
for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done;
Does the same thing, but w/o a for loop: https://gist.github.com/1685784
Thanks for posting, much easier than manually going through directories or creating a hardcoded script that's wrong next Yii release. I must be missing something regarding the recursion though. Is it actually iterative?