我怎样才能摆脱Eclipse Git的“冲突”?全部合并后的图标已解决? [英] How can I get rid of Eclipse Git "conflict" icons after all merges are resolved?
问题描述
在Eclipse 4.5.2中,在Eclipse 4.5.2中,在Eclipse中的Git冲突图标上显示了很多文件,尽管看起来我已经解决了任何可能的冲突。在项目视图中,我选择一个项目根目录,然后右键单击 - >比较分支 origin / master 。接下来,我们看到Team Synchronization视图。许多文件显示红色冲突图标。,但他们不应该。
Git staging视图,应该显示冲突, 是空的。我已经试过合并;提交合并(没有任何事情需要执行)。我尝试从Git Staging视图添加到索引;甚至从团队同步视图覆盖。比较本地文件和原始文件显示它们是相同的。
Git设置 autocrlf 是 true ,所以不是问题。
这种情况会重复发生。
为什么我会看到这个冲突图标?如何摆脱它?
您是否做过拉
?或者在 Team Synchronization
比较的地方?根据我的经验,团队同步
透视混淆了大多数人。
通常应该使用只读。不要试图解决这里的任何冲突。默认情况下,您将您的工作副本与远程存储库进行比较。这意味着你的工作副本中实际上没有冲突。当你在这里修复它们时,你只是在进行本地修改。你可以提交,但它不能解决任何冲突。它使得实际的冲突更难以解决。
所以,不要在 Team Synchronization
透视图中做任何事情。只需执行 pull
即可在工作副本中产生冲突,然后解决它们。通过将合并冲突移动到 Staged Changes
来标记合并冲突。 如果某个事件中断并且您希望新的尝试在本地存储库的最后一次提交中执行 reset --hard
。
I get the Git conflict icon in Eclipse on lots of files, even though it seems that I resolved any possible conflicts.
In Eclipse 4.5.2, in the Project view, I select a project root and do right-click -> Compare to branch origin/master. Next, we see the Team Synchronization view. Many files show a red conflict icon., but they should not.
The Git staging view, which is supposed to show conflicts, is empty. I already tried Merge; Committing the merge (nothing remains to be committed). I tried Add to Index from the Git Staging view; and even Overwrite from the Team Synchronization view. Comparing the local and origin files shows that they are identical.
Git setting autocrlf is true, so that is not the issue.
This occurs repeatedly.
Why do I see this conflict icon? How can I get rid of it?
Did you do a pull
? Or where you just comparing in Team Synchronization
? In my experience the Team Synchronization
perspective confuses the most people.
In general it should be used "read-only". Don't try to resolve any conflicts here. Per default you are comparing your working copy against the remote repository. Which means you actually have no conflict in your working copy. When you "fix" them here you are just making a local modification. You can commit that but it doesn't resolve any conflict. It makes the actual conflict even harder to resolve.
So don't do anything in the Team Synchronization
perspective. Just do a pull
to have those conflicts in your working copy and then resolve them. A merge conflict is marked as merged by moving them to the Staged Changes
.
If something breaks and you want a new try do a reset --hard
on the last commit in your local repository.
这篇关于我怎样才能摆脱Eclipse Git的“冲突”?全部合并后的图标已解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!