Git clone的时候可以clone 空文件,但是在推送的时候不能保留空文件,可以在空文件下面添加.gitkeep文件,保留空文件夹,方法如下,在项目版本库根目录下执行如下命令:
find .-type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;
git add .
git commit -m "keep empty folders"
git push origin master
Git clone的时候可以clone 空文件,但是在推送的时候不能保留空文件,可以在空文件下面添加.gitkeep文件,保留空文件夹,方法如下,在项目版本库根目录下执行如下命令:
find .-type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;
git add .
git commit -m "keep empty folders"
git push origin master