handle .gitignore and empty dir