git在默认情况是不会跟踪空的文件夹的,因为它认为这个没有意思。
但是在一些情况下我们需要记录这些空文件夹的结构,或者是为了备用考虑。
通常的做法是在该文件夹下添加一个 .gitkeep
的空文件,这样git就可以对这个文件夹进行跟踪了。
为空目录批量添加文件.gitkeep:
find ./ -empty -type d -print0 | xargs -0 -I {} touch "{}\.gitkeep"
参考
https://blog.csdn.net/uddiqpl/article/details/128457755
https://blog.csdn.net/fangye945a/article/details/110071075