Merge using EGit results in commit of all changes as done by the merger

笑着哭i 提交于 2019-12-10 10:17:36

问题


I'm using Eclipse with EGit and and my origin/master is on github. On this project are working 3 programmers.

When I pull changes to my local git (using EGit) and there are conflicts I solve them, no problem.

The thing is that when I commit, it commits a merge that includes all the changed files since my last commit (before pull) and in git I see all these changes by other programmers as if done by me on this last commit of the merge...

Why does this happen? What am I doing wrong?

Update (14.10.2012): Thanks to @robinst I managed to correctly commit a correct merge with only the merged files.

but still two issues: (1) the merge tool was unavailable, why would that be? (gray and unable to click on it); (2) I did not find any "Git Staging" view... where is it hiding?


回答1:


When a merge has conflicts, instead of automatically committing the merge result (as in the no-conflict case), the unconflicting files are staged and the files with conflicts are in "conflicting" state. Then you have to resolve the conflicts in each file and then stage it.

After you have resolved all conflicts (and staged the files), you have to commit the merge. When you are using the Git Staging view, you will see that the message changes to the merge message after resolving all conflicts. After that, press on the Commit icon in the toolbar.

Only then you can continue working on your commits.

Sounds like you did not commit the merge after you resolved all conflicts and now have a mix of the merge result and your own changes. Could this be the case?



来源:https://stackoverflow.com/questions/12704528/merge-using-egit-results-in-commit-of-all-changes-as-done-by-the-merger

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!