Git添加空文件夹的方法

来源:互联网 发布:linux cpuinfo 编辑:程序博客网 时间:2024/06/05 04:13

转自stackoverflow:
http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository
中文部分:
http://www.cnblogs.com/jinzhao/archive/2012/03/21/2410156.html


Another way to make a directory stay empty (in the repo) is to create a .gitignore inside that directory that contains two lines:

在空目录下创建.gitignore文件。

文件内写入如下代码,可以排除空目录下所有文件被跟踪:

# Ignore everything in this directory * # Except this file !.gitignore 
0 0