我最近在存储库 View 中误点击并 merge 了两个不能(也不应该) merge 的提交。结果是 merge 冲突。
native git 有 git merge --abort
用于这种情况。
但是,我在 egit 中找不到这样的选项。
最佳答案
检查“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.
还原所有本地和暂存的更改
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. Choosehard
here.- Open the context menu on the HEAD commit in the history view and select Hard Reset.
确保您没有任何本地修改:硬重置会丢失。
关于git - 中止 egit 中的冲突 merge ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18785404/