Difference when ignoring files in folder with git
This question already has an answer here:
 git does not track empty folders, thus if it thinks nothing is inside of it, it won't add it.  One solution to your problem would be instead of adding /tmp/* to your global .gitignore file, put one into the /tmp/ folder, just containing  
*
!.gitignore
 and commit this file.  In this way, /tmp/ won't be empty to git and thus be added to the repository, but no further files would be.  
上一篇: 使用gitignore创建存储库
下一篇: 使用git忽略文件夹中的文件时的差异
