git 致命:合并文件的多个阶段条目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29316831/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:51:03  来源:igfitidea点击:

git fatal: multiple stage entries for merged file

gitmacos

提问by Qeychon

Git throws an error:

Git 抛出一个错误:

fatal: multiple stage entries for merged file

I've been on the side (Getting a fatal error in git for multiple stage entries) and read the workaround:

我一直站在一边(在多个阶段条目的 git 中出现致命错误)并阅读解决方法:

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

Now, the changes can be queried via status, but after that what i have to do now? When I use git add, then everything back to last version. All changes are gone. The changes were removed and my new repo has the old status again. How can i put all change to the new repository? I use git version 2.2.0 on OS X 10.10.

现在,可以通过状态查询更改,但在那之后我现在必须做什么?当我使用 git add 时,一切都会回到上一个版本。所有的变化都没有了。更改已删除,我的新存储库再次具有旧状态。如何将所有更改放入新存储库?我在 OS X 10.10 上使用 git 版本 2.2.0。

回答by Codios

I resolved this problem:

我解决了这个问题:

In your terminal, type this:

在你的终端中,输入:

rm .git/index (press enter key)
git add -A (press enter key)
git commit -m "your commit instruction"