Git does not track directories at present (see the Git wiki ), that is, you cannot add empty directories and git will not delete directories that end up empty. (EDIT: Thank you, Manny, I was wrong! You cannot add empty directories, but git will delete directories that become empty because their tracked content has been deleted. )
Regarding the command to delete empty directories: it depends on your operating system.
For Linux, you can use, for example,
find -depth -type d -empty -exec rmdir {} \;
However, this will delete all empty directories!
janko Sep 30 '09 at 16:23 2009-09-30 16:23
source share