find . -type d -empty -exec touch {}/.gitkeep \;

会在项目中每个空文件中生成 .gitkeep