我正在建立一个 Lemonstand 网站,我正在通过 git 进行管理。因此,我使用以下 .gitignore 规则:
# Lemonstand
.htaccess
php.ini
boot.php
index.php
install.php
/config/*
/controllers/*
/init/*
/logs/*
/phproad/*
/temp/*
/uploaded/*
/installer_files/*
/modules/backend/*
/modules/blog/*
/modules/cms/*
/modules/core/*
/modules/session/*
/modules/shop/*
/modules/system/*
/modules/users/*
# add content_*.php if you don't want erase client changes to content
/modules/gallery/*
/modules/lddevel/*
/modules/tweak/*
(我从 github 获得的顶部块,第二块是我自己添加的一些附加规则,以避免 Lemonstands 更新系统出现问题)。
我的问题是我正在向 Lemonstand 添加一个自定义发票,这(长话短说)需要在 中添加一个文件夹和一些文件/modules/shop/invoice_templates/
,我将其命名为cm_standard
.
因为这是默认 Lemonstand 的额外内容,所以我想用 git 跟踪它,所以我尝试在我的 gitignore 文件底部使用以下规则:
!/modules/shop/invoice_templates/cm_standard/*
但是当我做 a 时git add -A
,它并没有拾取该目录中的文件。即使我这样做,git add modules/shop/invoice_templates/cm_standard/*
它也会告诉我:
The following paths are ignored by one of your .gitignore files:
modules/shop/invoice_templates
Use -f if you really want to add them.
fatal: no files added
这进一步表明我没有正确编写规则 - 任何人都可以帮忙吗?谢谢你。