Another way to make a directory stay empty (in the repository) is to create a .gitignore file inside that directory that contains four lines:
# Ignore everything in this directory
*
# Except this file
!.gitignore
Then you don’t have to get the order right the way that you have to do in m104’s solution.
参考文献:
1.How can I add an empty directory to a Git repository?