在git中为多个阶段条目获取致命错误 [英] Getting a fatal error in git for multiple stage entries

查看:74
本文介绍了在git中为多个阶段条目获取致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

 致命:合并文件的多个阶段条目'Assets / Prefabs / Resources' 

没有注意到我推送了,没有给出错误信息,实际上是说一切都是最新的
所以我检查了bitbucket(回购被保存的地方),它没有显示我的提交。所以我检查了我的本地日志,也没有显示我的提交。



我已经查看了Google的答案...没有。这个错误是什么?和我该如何解决它?

解决方案

第一个解决方法,似乎与最近版本的Git(2.3+,Q2 + 2015)在授权更新的答案


  1. 删除索引

      $ rm .git / index 


  2. 全部添加

      $ git add -A 
    $ li $提交

    $ $ p $ $ $ $ $ $ $ git commit -a







原件答案(2014年末)

通常的解决方法是:


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

      $ cd / patH / to / second /克隆/回购
    $ git --work-tree = / path / to / first / repo add。




您可以在 read-cache.c ,在这个补丁中讨论( read-cache.c :确保未移除的条目被移除),并引入 Git 2.2提交

由于这是近期的,所以降级 Git 2.1版就足够了,不会受到该补丁的影响。 OP Daniel Toebe 增加了中评论


这个问题发生在我的macbook上,后者决定让我失败,另一台电脑出事了,在我的项目后面。



Using Git version 2.2.0 with unity game engine on OS X, and wanted to commit my code. I added everything and did not get an error message. then commit -m , and got this error message:

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

Not noticing it I pushed, that didn't give an error message, in fact said Everything up-to-date So I checked bitbucket (where the repo is held) and it didn't show my commit. so I checked my local log and that also does not show my commit.

I've looked into google for an answer... and nothing. what is this error? and how can I fix it?

解决方案

The first workaround, which seems to work with recent versions of Git (2.3+, Q2+ 2015) is mentioned in grant's more up-to-date answer:

  1. Delete the index

    $ rm .git/index
    

  2. Add all

    $ git add -A
    

  3. Commit

    $ git commit -a
    


Original answer (late 2014)
The usual workaround is to:

  • clone again the remote repo into a new local repo
  • add the changes from the first repo to the second one:

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

You can see this error message in read-cache.c, discussed in this patch ("read-cache.c: Ensure unmerged entries are removed "), and introduced in the Git 2.2 commit.
Since this is so recent, it is possible that downgrading Git to 2.1 would be enough to not be affected by that patch.

The OP Daniel Toebe adds 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中为多个阶段条目获取致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆