【发布时间】:2014-07-10 13:30:36
【问题描述】:
这是我的 .gitignore:
#ignore all kind of files
*
#except php files
!*.php
我只想忽略所有类型的文件,除了 .php 文件,但是有了这个 .gitignore 我也忽略了文件夹......
有没有办法告诉 git 接受我的项目文件夹结构,同时只跟踪 .php 文件?
现在我似乎无法将文件夹添加到我的仓库:
vivo@vivoPC:~/workspace/motor$ git add my_folder/
The following paths are ignored by one of your .gitignore files:
my_folder
Use -f if you really want to add them.
fatal: no files added
【问题讨论】:
-
git 只跟踪文件而不是目录。如果忽略目录中的所有文件,则不会将其添加到项目中。
-
我已经编辑了我的问题,现在好像无法添加该文件夹。
-
目录中有什么?
-
大量不同类型的文件(.php、.sql、其他子文件夹...)