在空目录下创建.gitignore文件。 文件内写入如下代码,可以排除空目录下所有文件被跟踪: # Ignore everything in this directory * # Except this file !.gitignore