gpt4 book ai didi

eclipse - 如何解决 EGit 中的冲突

转载 作者:IT王子 更新时间:2023-10-29 00:43:31 24 4
gpt4 key购买 nike

我在 Eclipse v4.3 上使用 EGit (开普勒)。我想提交并推送我的更改。我先做一个 pull ,一个文件有冲突。手动解决冲突后(本地和远程现在一样),我仍然遇到问题。

以下是每个操作的错误消息:

向上游推送

master: master [rejected - non-fast-forward]

pull

Cannot pull into a repository with state: MERGING_RESOLVED

标记为 merge

Failed to add resource to index Failed to add resource to index Exception caught during execution of add command

硬重置

An internal error occurred during: "Resetting to refs/heads/master". Exception caught during execution of reset command. {0}

如何消除冲突并推送更改?我做错了什么?

最佳答案

您使用的是团队同步 View 吗?如果是这样,那就是问题所在。团队同步 View 中的冲突解决不适用于 EGit。相反,您需要使用 Git 存储库 View 。

打开 Git 透视图。在 Git 存储库 View 中,转到 BranchesLocalmaster 并右键单击 → Merge...

它应该自动选择远程跟踪origin/master。按 merge

它应该显示result:conflict

打开冲突文件。他们应该在文件中有一个旧的 sk000l >>>> ===== <<<< 样式 merge 冲突。编辑文件以解决冲突,然后保存。

现在在“Git Staging” View 中,它应该在“Unstaged Changes”中显示更改的文件。右键单击并“添加到索引

Enter image description here

对所有剩余文件重复此操作。

现在从“git staging” View ,提交并推送。由于 Git/Eclipse 现在知道您已将远程源更改 merge 到您的母版中,因此您应该避免非快进错误。

不是直接编辑冲突的文件,你可以使用replace with -> ours/theirs来接受所有冲突的一个版本

replace with their image

关于eclipse - 如何解决 EGit 中的冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21559119/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com