gpt4 book ai didi

git - 在 git 中获取多个阶段条目的 fatal error

转载 作者:IT王子 更新时间:2023-10-29 01:14:13 26 4
gpt4 key购买 nike

在 OS X 上使用带有统一游戏引擎的 Git 2.2.0 版,并想提交我的代码。我添加了所有内容,但没有收到错误消息。然后提交 -m ,并收到此错误消息:

fatal: multiple stage entries for merged file 'Assets/Prefabs/Resources'

我没有注意到它,它没有给出错误消息,实际上是说 Everything up-to-date所以我检查了 bitbucket(存储 repo 的地方),它没有显示我的提交。所以我检查了我的本地日志,也没有显示我的提交。

我已经在谷歌上寻找答案...但没有。这是什么错误?我该如何解决?

最佳答案

第一个解决方法似乎适用于最新版本的 Git(2.3+,Q2+ 2015),在 grant 中提到。的 more up-to-date answer :

  1. 删除索引

    $ rm .git/index
  2. 全部添加

    $ git add -A
  3. 提交

    $ git commit -a

原始答案(2014 年底)
通常的解决方法是:

  • 再次克隆远程仓库到一个新的本地仓库
  • 将第一个仓库的更改添加到第二个仓库:

    $ cd /patH/to/second/cloned/repo
    $ git --work-tree=/path/to/first/repo add .

您可以在 read-cache.c 中看到此错误消息, 在此补丁 ("read-cache.c: Ensure unmerged entries are removed ") 中讨论,并在 Git 2.2 commit 中介绍.
由于这是最近的事, Git 降级到 2.1 可能足以不受该补丁的影响。

OP Daniel Toebe添加 in the comments :

The issue happened on my macbook, which decided to fail on me, and another computer mishap put me way behind on my projects.

关于git - 在 git 中获取多个阶段条目的 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27330446/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com