In Git, you can’t commit empty folders, because Git does not actually save folders, only files. You’ll have to create some placeholder file inside those directories, if you actually want them to be “empty”.

You could create a empty .gitignore file inside each empty folder. I find this confusing, since the goal is to keep the empty directories, not ignore them or some files inside of them.

With the following script you can create a file named “.gitkeep” inside every empty folder. The filename has no meaning for git, but it makes it purpose clear.

find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;