코린이의 기록

[Eclipse/Git] Cannot pull into a repository with state: MERGING_RESOLVED 본문

IDE/Eclipse

[Eclipse/Git] Cannot pull into a repository with state: MERGING_RESOLVED

코린이예요 2019. 1. 17. 15:18
반응형

해결 방법


The problem here is remote repository files have been changed(i.e. someone else have changed and pushed the file to the repository which you changed in your local copy) and now you also edited the same.So when you try to push the file it throws an error.
You have to merge the file and then commit the changes and push.

Right click on your project -> Team ->Merge

When you do this it will ask for which branch to merge. Select the branch and proceed to merge.

case 1: If there is no conflict, then merge process will be completed. You can commit and push now.

case 2: In case if there is a conflict egit will show the error message as Conflict and all those files having conflict will be marked with a red icon over the file name on your project explorer.

Right click the files with conflict-> Team -> Merge Tool

This will open the comparision window.Check and merge the changes you want. Once you completed merging

Right click the files with conflict-> Team -> Add to index Commit the changes and Push

Note : You have to commit all your staged files before this merging process.
And to answer your question 
"Actually, better question, how do I prevent this?"
This is not an issue, it happens when multiple users are working in a single repository.Whenever you tend to push, before pushing try pulling from the remote repository.When you try to pull egit will say if there is any pending changes or conflicts in remote repository and you solve the conflicts and push.

Reference : https://stackoverflow.com/questions/31037250/how-do-i-fix-cannot-pull-into-a-repository-with-state-merging-in-egit


나의 경우는 merge가 disable 상태여서 (이것저것 누르다 merge 했나봄..) Add to index를 한 후에 push를 했더니 정상적으로 push가 되었다.

반응형

'IDE > Eclipse' 카테고리의 다른 글

[Eclipse] Eclipse Tomcat 8.5 installation error  (0) 2018.11.09
[Eclipse] Gitlab 연동  (0) 2018.09.03
[Eclipse] error: unmappable character for encoding MS949  (0) 2018.06.15
Comments