如何解决egit中的冲突 [英] How to resolve conflicts in egit
问题描述
以下是每个操作的错误消息:
推送到上游
主人:主人[拒绝 - 非快进]
拉
无法使用状态拉入存储库:MERGING_RESOLVED
标记为合并
无法向索引添加资源无法向索引添加资源在执行添加命令期间捕获的异常
硬重置
在重置为refs / heads / master期间发生内部错误。
执行reset命令时捕获异常。 {0}
如何删除冲突并推动我的更改?我究竟做错了什么?谢谢
您是否使用Team Synchronize视图?如果是这样的问题。 团队同步视图中的冲突解决不适用于eGit。相反,您需要使用Git Repository视图。
打开git透视图。在Git Repository视图中,转到分支机构 - > Local-> master,然后右键单击 - >合并...
它应该自动选择远程跟踪 - >起始/主。按合并。
应该会导致:冲突
打开冲突的文件,它应该有旧的sk000l> >>> =====<<<<<风格合并冲突的文件。编辑文件以解决冲突,并保存。
现在,在Git Staging视图中,它应该在Unstaged Changes中显示已更改的文件。右键单击并选择添加到索引
对任何剩余的文件重复。
现在从'git staging'视图,提交和推送。由于Git / Eclipse现在知道您将远程源代码更改合并到主服务器中,您应该避免非快速向前错误。
I am using egit on eclipse kepler. I want to commit and push my changes. I do a pull first and 1 file is conflicting. After manually resolving the conflict(local and remote are the same now), I am still running into problems. Here are the error messages for each action:
Push to upstream
master: master [rejected - non-fast-forward]
Pull
Cannot pull into a repository with state: MERGING_RESOLVED
Mark as merged
Failed to add resource to index Failed to add resource to index Exception caught during execution of add command
Hard reset
An internal error occurred during: "Resetting to refs/heads/master". Exception caught during execution of reset command. {0}
How can I remove the conflict and push my changes? What am I doing wrong? Thanks
Are you using the Team Synchronise view? If so that's the problem. Conflict resolution in the Team Synchronise view doesn't work with eGit. Instead you need to use the Git Repository view.
Open the git perspective. In the Git Repository view, go to on Branches->Local->master and right click -> Merge...
It should auto select Remote Tracking -> origin/master. Press Merge.
It will should result:conflict
Open the conflicting files, it should have old sk000l >>>> ===== <<<< style merge conflict in the file. Edit the file to resolve the conflict, and save.
Now in the 'Git Staging' view, it should show the changed file in 'Unstaged Changes'. Right click and 'Add to Index'
Repeat for any remaining files.
Now from the 'git staging' view, commit and push. As Git/Eclipse now knows that you have merged the remote origin changes into your master, you should avoid the non-fast-forward error.
这篇关于如何解决egit中的冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!