Abort conflicting merge in egit

你离开我真会死。 提交于 2019-12-18 18:59:35

问题


I recently did a misclick in the repositories view and merged two commits that can't (and shouldn't) be merged. The result was a merge conflict.

Native git has git merge --abort for such cases.

However, i cant find such an option in egit.


回答1:


Check the section "Aborting a merge":

If a merge resulted in conflicts you can abort the merge with a hard reset to the current branch. This can be done in state "Conflicts" and in state "Merged", i.e. before and after you have resolved the conflicts.

The hard reset can be done from the team menu, the Git Repositories View or the History View. See Revert all local and staged changes for more details.

Revert all local and staged changes

This can be done as a special case of reset. If you reset to the current HEAD (normally the last commit on your branch) with the option hard you overwrite the working tree and the index with the content of the HEAD. You can do this in three ways:

  • Select Team > Reset... on a project. In the dialog select HEAD or your current branch and switch the radio button to hard.
  • Right click and select Reset... on any branch or tag in the Repositories view. This opens a dialog which lets you decide on the reset type. Choose hard here.
  • Open the context menu on the HEAD commit in the history view and select Hard Reset.

Make sure you didn't have any local modifications: there would be lost with a hard reset.



来源:https://stackoverflow.com/questions/18785404/abort-conflicting-merge-in-egit

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