不考虑添加到 .gitignore 的 .factorypath

.factorypath added to .gitignore is not taken into account

.gitignore同目录下有

.factorypath
/.factorypath

已为 eclipse 项目添加。但只要此文件发生任何更改,在 git 或 smartgit.

下修改后仍然可见

知道为什么吗?

很可能文件 .factorypath 在您将其排除在 .gitignore 中之前已添加到 git。来自 git忽略文档 (http://git-scm.com/docs/gitignore):

NOTES The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked. To stop tracking a file that is currently tracked, use git rm --cached.

要显示 git 当前跟踪的文件,您可以使用 git ls-files。 如上面引用的停止跟踪文件使用所述: git rm --cached .factorypath。 这将保留文件的工作树副本,但将其从索引中删除。

因为文件之前被跟踪过。考虑到这一点,这个问题已经 answered here.