Skip to content

Instantly share code, notes, and snippets.

@johnnyicon
johnnyicon / Recursively add .gitignore files to empty dirs
Last active August 29, 2015 14:02
Recursively add .gitignore to all subfolders within a directory
# 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 ``./[^.].*''); do touch $i"/.gitignore"; done;