git add empty directory

In order to ensure the integrity of the project structure, we have to submit an empty folder when we first build the project, but git ignores empty directories by default.

At this time, we only need to execute in the git root directory

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

You can upload an empty folder. In essence, you create a .gitignore file in the empty directory, and then delete the file after you create a new file in the folder.

 

Published 69 original articles · Like 72 · Visit 240,000+

Guess you like

Origin blog.csdn.net/londa/article/details/98446437