git空目录处理
- Git 只跟踪文件,不跟踪目录本身。当本地存在空目录时不会提交,所以要处理。
批量在空目录下添加.gitkeep文件:
# 查找所有空文件夹并添加 .gitkeep
find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;
批量在空目录下添加.gitkeep文件:
# 查找所有空文件夹并添加 .gitkeep
find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;