尽管 gitignore 应该忽略文件,但文件存在冲突

Files are in conflict despite gitignore should ignore them

我有一些文件存在冲突,尽管 .gitignore 应该忽略它们。如果我尝试更新解决方案,我会得到 Unmerged path.

git status 带来以下内容:

On branch master
Your branch is up-to-date with 'origin/master'.

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add/rm <file>..." as appropriate to mark resolution)

    deleted by us:   abc_Library.userprefs
    deleted by us:   abc_Library/bin/Debug/abc_Library.dll
    deleted by us:   abc_Library/bin/Debug/abc_Library.dll.mdb
    deleted by us:   abc_Library/obj/Debug/abc_Library.dll

no changes added to commit (use "git add" and/or "git commit -a")

我已经定义了以下内容.gitignore

[Bb]in/
[Oo]bj/
*.userprefs
.DS_Store

我记得我已经 fixed the untracked files。会不会是某个团队成员没有gitignore文件,又添加了不需要的文件?或者我应该再次修复未跟踪的文件?

编辑:

现在我用了

git rm --cached abc_Library/obj/Debug/abc_Library.dll

并且文件不再显示为冲突。

.gitignore 的文档摘录:

A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected.

当您向 .gitignore 添加文件名、路径或模式时,您应该从存储库中删除受影响的文件:

git rm --cached abc_Library.userprefs

选项 --cached 要求 git 仅从索引中删除文件,以这种方式准备在下一次提交时从存储库中删除。工作树中的文件,无论修改与否,都不会受到任何影响。