【问题标题】:Git produces "BUG: There are unmerged index entries"Git产生“BUG:有未合并的索引条目”
【发布时间】:2011-10-09 07:51:16
【问题描述】:

做的时候:

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

注意:我最近将我的一个目录移到了一个单独的子模块中。现在我因此而发生了很多冲突。这个bug似乎与此有关。

【问题讨论】:

标签: git debugging merge fatal-error


【解决方案1】:

该错误消息是 introduced in January 2010,为了帮助调试此案例,Junio C. Hamano 建议将 GIT_MERGE_VERBOSITY 设置为 5:

我们可能希望建议用户将GIT_MERGE_VERBOSITY 设置为 5 并在消息中重新运行合并。
至少我们会知道process_renames()process_entry() 函数的哪一部分没有正确处理未合并的路径,这可能有助于我们诊断问题。

OP julkiewicz 报告

CONFLICT (directory/file): 
There is a directory with name doc in Temporary merge branch 1. 
Adding doc as doc~Temporary merge branch 2

允许隔离导致此错误消息的目录。

【讨论】:

    【解决方案2】:

    我刚刚删除了当前结帐中的doc/(冲突文件夹)并重新运行合并。有一些冲突,但这次没有错误。

    【讨论】:

    • 优秀。我已经发布了我在评论中提到的链接作为更多可见性的答案。
    【解决方案3】:

    当我遇到此错误时,关闭重命名检测对我有用。

    git merge --no-ff -s recursive -X no-renames <branchToMerge>
    

    【讨论】:

    • 添加无重命名会导致错误“合并:无重命名 - 我们不能合并”
    【解决方案4】:

    以防万一这对某人有所帮助,因为解决方案也是改变策略:

    git 合并 -s 我们的

    base 分支很久以前就已经转移了,rebase 是不可能的,所以这解决了从我的分支带来更改的问题,同时保留当前分支上的内容。

    【讨论】:

      猜你喜欢
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-08
      • 1970-01-01
      • 1970-01-01
      • 2010-11-17
      • 2013-07-16
      相关资源
      最近更新 更多