Cannot pull into a repository with state: MERGING_RESOLVED

本文介绍如何在Eclipse Kepler中解决Git版本控制遇到的文件冲突问题,包括手动解决冲突后的推送失败、硬重置错误等,并提供了一套完整的解决流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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'
enter image description hereRepeat 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值