Git“无法从未完全合并的索引创建树”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32529262/
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
Git "Cannot create a tree from a not fully merged index"
提问by Jesse
I changed a long list of files in Visual Studio 2013, and am now trying to commit them as well as sync them with the changes that others have made (We are using bitbucket, if that makes a difference). When trying to commit, I entered the commit message, but then get the error
我在 Visual Studio 2013 中更改了一长串文件,现在尝试提交它们并将它们与其他人所做的更改同步(我们正在使用 bitbucket,如果这有区别的话)。尝试提交时,我输入了提交消息,但随后收到错误
"An error occurred. Detailed message: Cannot create a tree from a not fully merged index. "
“发生错误。详细消息:无法从未完全合并的索引创建树。”
I am not very experienced with git, so any help would be greatly appreciated!
我对 git 不是很有经验,所以任何帮助将不胜感激!
回答by RandonneurLibre
I just had this same problem. Raina77owlinked to the answer, but to elaborate here: open a git Bash in your working directory and run git status
. From there, you will see what your problems are.
我刚刚遇到了同样的问题。Raina77ow链接到答案,但在此详细说明:在您的工作目录中打开一个 git Bash 并运行git status
. 从那里,你会看到你的问题是什么。
For me, it's often because of a unresolved merge conflict. If there are unmerged paths and you want to use your local changes, i.e. mark which files are the conflict resolution, run git add [filePath\fileName]
.
对我来说,这通常是因为未解决的合并冲突。如果存在未合并的路径并且您想使用本地更改,即标记哪些文件是冲突解决方案,请运行git add [filePath\fileName]
.
If you want to discard the changes, i.e. unstage the file, use git reset HEAD [filePath\fileName]
.
如果要放弃更改,即取消暂存文件,请使用git reset HEAD [filePath\fileName]
.