【发布时间】:2018-01-03 15:11:41
【问题描述】:
当我尝试将 git 中的任何分支合并到 master 中时,我得到 error: addinfo_cache failed for path 'file'。
我做什么:
>git checkout master
>git merge other-branch
Git 给了我:
error: addinfo_cache failed for path 'file'
file: unmerged (581c47f7d0e1a0bc825d528d9783ac18ee0cce27)
file: unmerged (26a0c24dccd2bc2f74e20488ca01bba2fcd9cf56)
file: unmerged (3be471ca5c689693339827a455f187814677642f)
fatal: git write-tree failed to write a tree
>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 <file>..." to mark resolution)
both modified: file
no changes added to commit (use "git add" and/or "git commit -a")
我不知道该怎么做,也找不到任何问题。
【问题讨论】:
-
add_cacheinfo failed for path ...是一个内部错误,不应发生。 Git 内部的某些东西坏了,或者你的计算机内部的某些东西坏了/失败了。如果问题在另一台计算机上仍然存在,则表明这是您使用的任何版本的 Git 中的错误;您可以尝试使用不同版本的 Git。 -
我刚在家里的电脑上测试过,没有问题。我将在工作中删除整个
.git文件夹。希望能解决它。 -
删除
.git并克隆它新的解决了这个问题。谢谢。你想写你的评论作为答案,那么我会接受它。 -
嗯,还是很神秘。这不是修复,而是一种解决方法。 :-) 实际问题和正确的解决方法仍然未知......
-
OK 认为该消息只是表明存储库已损坏。非常感谢您的帮助。