Java Eclipse 存储库状态冲突错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22636772/
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
Eclipse Repository State Conflict Error
提问by ylun.ca
When my partner attempts to commit his update to BitBucket, he comes across the following error:
当我的伙伴尝试将他的更新提交到 BitBucket 时,他遇到以下错误:
Repository State: Conflicts
The IDE does not tell us any further details about the conflicts and does not mark any issues in his code.
IDE 不会告诉我们有关冲突的任何进一步详细信息,也不会在其代码中标记任何问题。
What is going on and how can we fix this?
这是怎么回事,我们如何解决这个问题?
采纳答案by Sharif
If you do not have any uncommitted change then do a hard reset from Team > reset > (select Hard option) do a pull request again. find all the conflicted file(file with red diamond icon) Resolve any conflict (manually edit the file, or use merge tool),
如果您没有任何未提交的更改,则从 Team > reset >(选择 Hard 选项)执行一次硬重置,再次执行拉取请求。找到所有冲突的文件(带有红色菱形图标的文件)解决任何冲突(手动编辑文件,或使用合并工具),
then right click on all(one by one ) conflicting files, select "team", then select "Add to Index".
然后右键单击所有(一个一个)冲突文件,选择“团队”,然后选择“添加到索引”。
(if every conflict is resolve then there should not be any conflict(red diamond) icon. before trying to commit anything make sure all the conflict is revolved)
(如果每个冲突都已解决,则不应有任何冲突(红色菱形)图标。在尝试提交任何内容之前,请确保所有冲突都已解决)
now you should be able to commit to git again
现在你应该能够再次提交到 git
回答by Soichi Hayashi
I am not exactly sure what is causing the conflict, but your partner should be able to see which files are conflicting by looking for a red diamond inside the Package Explorer. Resolve any conflict (manually edit the file, or use merge tool), then right click on all conflicting files, select "team", then select "Add to Index". After that, your partner should be able to commit to git again.
我不确定是什么导致了冲突,但您的合作伙伴应该能够通过在包资源管理器中查找红色菱形来查看哪些文件发生冲突。解决任何冲突(手动编辑文件,或使用合并工具),然后右键单击所有冲突文件,选择“团队”,然后选择“添加到索引”。之后,您的合作伙伴应该能够再次提交 git。
I hope this helps!
我希望这有帮助!
回答by Thierry Boucheny
I know this is an old post but I ran into this problem yesterday. I had this Repository State: Conflicts message when I was trying to commit after removing all the conflicts. As I couldn't see anything wrong in Eclipse, I opened GitHub Desktop and it did show me straight away what was wrong. I work on MacOS X and there was a .DS_Store file in the workspace. This was the file where the conflict was. Eclipse wouldn't show it but thanks to GitHub Desktop, I managed to remove the conflict and then I could commit my changes in Eclipse. I hope it helps.
我知道这是一个旧帖子,但我昨天遇到了这个问题。我在删除所有冲突后尝试提交时收到此 Repository State: Conflicts 消息。由于我在 Eclipse 中没有发现任何问题,所以我打开了 GitHub Desktop,它确实立即向我展示了问题所在。我在 MacOS X 上工作,工作区中有一个 .DS_Store 文件。这是冲突所在的文件。Eclipse 不会显示它,但多亏了 GitHub Desktop,我设法消除了冲突,然后我可以在 Eclipse 中提交我的更改。我希望它有帮助。
回答by erginm
Sometimes there are files in projects that are not shown by IDEs. You should use git console commands like "git status" to check for those files, manually merge and add them by "git add filename". When all the conficting files are completed, you can commit again.
有时,IDE 未显示项目中的文件。您应该使用诸如“git status”之类的 git 控制台命令来检查这些文件,手动合并并通过“git add filename”添加它们。当所有冲突文件都完成后,您可以再次提交。
回答by Jeremy Daniel
In my case there is a .gitattributes file which is not visible to eclipse since it's not in any of the eclipse projects. It also had conflicts and was preventing the merge from being resolved. I had to do that one outside of eclipse and then do a refresh in eclipse.
就我而言,有一个 .gitattributes 文件对 eclipse 不可见,因为它不在任何 eclipse 项目中。它也有冲突,并阻止了合并的解决。我必须在 eclipse 之外做那个,然后在 eclipse 中刷新。