Git 产生“BUG:存在未合并的索引条目”
执行时:
git merge some-branch
我
BUG: There are unmerged index entries:
BUG: 3 docfatal: Bug in merge-recursive.c
不确定这意味着什么,但它看起来比通常更出乎意料。我该怎么办?有一些清理命令可以帮助我吗?
编辑
更糟糕的是,这个错误实际上沿着我的源版本之一传播。由于 some-branch
原本只是我本地的工作,所以我将其推送到远程服务器上。然后克隆一个新的存储库并尝试合并此副本上的上述分支并得到相同的消息。
编辑2
我使用了 GIT_MERGE_VERBOSITY=5 并得到:
$> export GIT_MERGE_VERBOSITY=5; git merge origin/funkload
Merging:
a1ef5a2 Uaktualniony INSTALL.
virtual origin/funkload
found 2 common ancestor(s):
d2eb442 Resources py.
119871b Nowy commit w doc.
Merging:
d2eb442 Resources py.
119871b Nowy commit w doc.
found 1 common ancestor(s):
62f4183 Poprawiony bug w obsłudze linków do resources, które są null.
Removing doc/concept/agreement.lyx
Removing doc/concept/agreement.pdf
Removing doc/concept/concept.lyx
...
Removing druglo-doc
Removing src/db/fixtures/initial.json
Skipped src/druglo/backend/actions/tests/fight.py (merged same as existing)
Auto-merging src/druglo/backend/characters/models/behaviours.py
CONFLICT (content): Merge conflict in src/druglo/backend/characters/models/behaviours.py
Auto-merging src/druglo/backend/players/models/players.py
Auto-merging src/druglo/backend/worlds/resources.py
CONFLICT (content): Merge conflict in src/druglo/backend/worlds/resources.py
Auto-merging src/druglo/common/integrity/webservices/resources.py
CONFLICT (content): Merge conflict in src/druglo/common/integrity/webservices/resources.py
Removing src/druglo/frontend/cityscreen/models.py
Removing src/druglo/frontend/forms.py
Removing src/druglo/frontend/mainscreen/models.py
Removing src/druglo/frontend/models.py
CONFLICT (directory/file): There is a directory with name doc in Temporary merge branch 1. Adding doc as doc~Temporary merge branch 2
BUG: There are unmerged index entries:
BUG: 3 docfatal: Bug in merge-recursive.c
注意:我最近将我的目录之一移到了一个单独的子模块中。现在我因此遇到了很多冲突。看来这个错误与此有关。
When doing:
git merge some-branch
I get
BUG: There are unmerged index entries:
BUG: 3 docfatal: Bug in merge-recursive.c
Not sure what this means, but it looks like something more unexpected then usually. What am I supposed to do with this? Is there some clean up command that could help me here?
EDIT
What is worse, this bug actually spreads along one of the versions of my source. As some-branch
was originally just my local work, I pushed it onto the remote server. Then cloned a fresh repository and tried to merge the aforementioned branch on this copy and got the same message.
EDIT 2
I used GIT_MERGE_VERBOSITY=5 and got:
gt; export GIT_MERGE_VERBOSITY=5; git merge origin/funkload
Merging:
a1ef5a2 Uaktualniony INSTALL.
virtual origin/funkload
found 2 common ancestor(s):
d2eb442 Resources py.
119871b Nowy commit w doc.
Merging:
d2eb442 Resources py.
119871b Nowy commit w doc.
found 1 common ancestor(s):
62f4183 Poprawiony bug w obsłudze linków do resources, które są null.
Removing doc/concept/agreement.lyx
Removing doc/concept/agreement.pdf
Removing doc/concept/concept.lyx
...
Removing druglo-doc
Removing src/db/fixtures/initial.json
Skipped src/druglo/backend/actions/tests/fight.py (merged same as existing)
Auto-merging src/druglo/backend/characters/models/behaviours.py
CONFLICT (content): Merge conflict in src/druglo/backend/characters/models/behaviours.py
Auto-merging src/druglo/backend/players/models/players.py
Auto-merging src/druglo/backend/worlds/resources.py
CONFLICT (content): Merge conflict in src/druglo/backend/worlds/resources.py
Auto-merging src/druglo/common/integrity/webservices/resources.py
CONFLICT (content): Merge conflict in src/druglo/common/integrity/webservices/resources.py
Removing src/druglo/frontend/cityscreen/models.py
Removing src/druglo/frontend/forms.py
Removing src/druglo/frontend/mainscreen/models.py
Removing src/druglo/frontend/models.py
CONFLICT (directory/file): There is a directory with name doc in Temporary merge branch 1. Adding doc as doc~Temporary merge branch 2
BUG: There are unmerged index entries:
BUG: 3 docfatal: Bug in merge-recursive.c
Note: I've recently moved one of my directories into a separate submodule. Now I get a lot of conflicts because of that. It seems the bug is related to that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
该错误消息是 2010 年 1 月引入,为了帮助调试此案例,Junio C. Hamano 建议设置
GIT_MERGE_VERBOSITY
到 5:OP julkiewicz 报告
允许隔离导致此错误消息的目录。
That error message was introduced in January 2010, and to help debug this case, Junio C. Hamano recommends settings
GIT_MERGE_VERBOSITY
to 5:The OP julkiewicz reports
which allowed for isolating the directory causing this error message.
我刚刚删除了当前签出中的 doc/(冲突文件夹)并重新运行合并。遇到了一些冲突,但是这次没有错误。
I've just removed the
doc/
(the conflicting folder) in the current checkout and re-run the merge. Got some conflicts but, no bugs this time.当我遇到此错误时,关闭重命名检测对我有用。
Turning off rename detection worked for me when I encountered this error.
以防万一这对某人有帮助,因为解决方案也是改变策略:
git merge -s ours
基础分支很久以前就转移了,不可能进行变基,所以这解决了我的更改带来的问题分支,同时保留当前分支上的内容。
Just in case this helps someone, for the the solution was to change the strategy as well:
git merge -s ours
The base branch had diverted way too long ago and a rebase was not possible, so this solved the issue bringing the changes from my branch while keeping what was on the current branch.