我从StackOverflow上阅读了许多关于此的文章,但在我的情况下我无法使其正常运行。
我想忽略除一个目录以外的所有目录。我在.gitignore中添加了以下内容:
app/design/frontend/base/default/template/
!app/design/frontend/base/default/template/mymodule/
但看起来这种否定根本不起作用。
该路径下有很多子文件夹app/design/frontend/base/default/template/
,并且在app/design/frontend/base/default/template/mymodule
文件夹中有一些文件(如果有区别的话)。
有人可以告诉我我在做什么错吗?
将白名单项放在忽略项的顶部:
!app/design/frontend/base/default/template/mymodule/
app/design/frontend/base/default/template/
如果仍然不起作用,则可能必须包括template
目录本身,但忽略目录下的所有文件,除了mymodule
:
app/design/frontend/base/default/template/*
!app/design/frontend/base/default/template/mymodule/
有关更多信息,请参见gitignore手册页。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句