为什么在 Eclipse 中对 Egit 管理的项目禁用合并工具?
根据 EGit 用户指南,要使用合并工具,应右键单击合并的资源冲突,然后选择团队> 合并工具。但是,当我执行此操作时,“合并工具”选项呈灰色。 Egit 正确检测到冲突并向我显示冲突文件的图标和文本标签装饰。
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
它对我来说被禁用了,因为我的隐藏列表中有一些更改。
为我解决了问题。
It was disabled for me because I had some changes on my stash list.
fixed the problem for me.
它可能取决于您正在使用的 Egit 版本以及导致冲突的操作。
例如,请参阅 bug 339092,其中提到在这种情况下未启用合并工具挑选后发生冲突:仅刚刚发布的 EGit 0.12 将支持这一点。
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.
合并工具被禁用的唯一时间(错误除外)是当您处于冲突状态以外的任何状态时;即,只有当状态为“冲突”时,您才会看到该选项已启用。在大多数视图中,状态显示在项目名称旁边,例如“项目资源管理器”和“同步”。
确保您已与所需的分支合并,然后如果合并导致冲突,您的项目将进入冲突模式,并且将启用合并工具。
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.
正如 VonC 提到的,这似乎是 EGit 中的一个错误,但修复很容易。我使用 Cherry Pick 选项存在的同一菜单上的重置分支选项来完成此操作。
注意:
git stash clear
没有帮助。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.如果您尝试将更改推送到远程并且需要从远程进行合并,则会发生这种情况。它失败并显示“not FF”,但同时也检测到冲突。不要问我为什么此时没有将整个项目标记为冲突。
打开同步选项卡,右键单击项目并选择“合并”。由于文件冲突,此操作立即失败,并且它会打开项目的冲突图标标签并启用“合并工具”选项。
这是针对 Eclipse Mars 中的 EGit 4.0.3。
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.
如果您处于分离的头部状态(在我的情况下,我已经签出了远程分支,然后忘记了),也会发生这种情况。
此外,即使在纠正了问题之后,您也可能必须选择不同的项目,然后重新选择您真正想要的项目(只需在包资源管理器视图中选择)才能更新菜单。
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.