Ensure GIT Tracks Empty Direcotries
November 27th, 2008This handy script will recursively search for any empty directories in your project and then add .gitignore files to any empty directories which are located. You do not want to spend time manually doing this on any reasonably sized or complicated project.
However, if you are in a hurry and just need to this as a one off then the one liner command below will be useful.
find . ( -type d -empty ) -and ( -not -regex ./.git.* ) -exec touch {}/.gitignore ;
This command is from Eric Goodwin.