Why is the merge tool disabled in Eclipse for a EGit-managed project?

北城余情 提交于 2020-01-01 08:01:12

问题


As per the EGit User Guide, to use the merge tool, one should right-click on the resource with a merge conflict and then select Team > Merge Tool. However, when I do this, the Merge Tool option is greyed out. EGit is properly detecting the conflict and showing me both the icon and text label decorations for the file in conflict.

Any ideas?


回答1:


It was disabled for me because I had some changes on my stash list.

$ git stash clear

fixed the problem for me.




回答2:


It can depend on the version of EGit you are using, and on the operation that lead to the conflict.
See for instance bug 339092 which mention merge tool being not enabled in the case of a conflict after cherry-picking: only the just released EGit 0.12 would support that.




回答3:


It seems to be a bug in EGit as VonC mentioned, but the fix is easy. I did it using reset branch option on the same menu that Cherry Pick option existed.

Note: git stash clear didn't help.




回答4:


The only time (other than a bug) that the Merge Tool would be disabled is that when you are in any status other than the Conflicts one; i.e. you will only see that option enabled when the status is Conflicts. The status is shown next to the project name in most views, such as Project Explorer and Synchronize.

Make sure you have merged with desired branch, then if your merge results in conflicts, your project will enter Conflicts mode, and the Merge Tool will be enabled.




回答5:


This happens if you tried to push changes to a remote and there were merges required from the remote. It fails with 'not FF' but also simultaneously detects the conflict. Don't ask me why it doesn't mark the whole project as conflicted at this point.

Open the Synchronize tab, right-click the project and select 'merge'. This immediately fails because of the conflicting file, and it switches on the conflict icon label for the project and enables the 'merge tool' option.

This is for EGit 4.0.3 in Eclipse Mars.




回答6:


This also happens if you're in detached head state (in my case, I had checked out a remote branch and then forgotten).

Also, even after you've corrected the problem, you may have to select a different project and then reselect the one you actually want (just selecting in the package explorer view) in order for the menu to update.



来源:https://stackoverflow.com/questions/5934765/why-is-the-merge-tool-disabled-in-eclipse-for-a-egit-managed-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!