.gitignore中排除的文件夹中的文件出现在提交

时间:2017-01-16 15:52:07

标签: git gitignore

我的.gitignore文件包含/var/文件夹:

/.idea
/media/
/var/
/errors/

但来自var/cache//.idea的文件会定期出现在新提交中。

是的,我在开始时对整个项目git init做了git rm -r --cached var/,但https://stackoverflow.com/a/1330097/6827096中也建议function wrapped() {}; const testFunc = new Proxy(wrapped, { maxInstances: 3, instances: 0, construct: function (target, argumentsList, newTarget) { if (this.instances >= this.maxInstances) { throw new Error('Ran out of instances...'); } this.instances++; return new wrapped(); } }); new testFunc(); new testFunc(); new testFunc(); new testFunc(); // throws ,但仍会显示新文件。 enter image description here

1 个答案:

答案 0 :(得分:2)

我认为它应该是,它取决于gitignore文件的位置。如果它在与文件夹相同的目录中执行如下操作:

.gitignore
.idea
/media
/var
/errors

或:

 .gitignore
 .idea
 media
 var
 errors

我会将此作为评论发布,但我还没有足够的代表。

相关问题