Cannot pull into a repository with state: MERGING_RESOLVED

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.

猜你喜欢

转载自blog.csdn.net/dotphoenix/article/details/79753334