2015-01-15 94 views
2

儘管.gitignore應該忽略它們,但我仍然有一些衝突的文件。如果我嘗試更新解決方案,我會得到Unmerged path儘管gitignore應該忽略它們,文件仍然存在衝突

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

和文件不會再出現衝突。

+3

*這可能是一個團隊成員沒有'.gitignore'文件* [...]?版本控制下的'.gitignore'文件本身? – Jubobs 2015-01-15 16:06:32

+0

我只將該文件添加到我的電腦。我如何驗證它是否受版本控制? – testing 2015-01-15 16:39:36

+1

嘗試運行,例如,'git ls-tree --name-only origin/master - .gitignore'。 – Jubobs 2015-01-15 16:42:25

回答

2

.gitignore文件的摘錄:

一個gitignore文件指定的Git應該忽略故意未跟蹤文件。 Git已經跟蹤的文件不受影響。

當您添加文件名,路徑或模式,以.gitignore你應該從你的資料庫中刪除受影響的文件:

git rm --cached abc_Library.userprefs 

選項--cached要求git只從索引中刪除文件,編制本在下一次提交時從存儲庫中刪除。來自工作樹的文件,無論是否修改,都不會受到任何影響。