Git意外地忽略了.gitignore中排除的文件

时间:2012-03-28 18:23:33

标签: git

我的.gitignore文件包含以下行:

make/
!make/*.mak

当我运行“git add make / file.mak”时,我收到以下错误:

The following paths are ignored by one of your .gitignore files:
make
Use -f if you really want to add them.
fatal: no files added

为什么在将make / file.mak添加到例外列表时出现此错误?

1 个答案:

答案 0 :(得分:2)

因为make/本身尚未被覆盖。将第一行更改为/make/*