git - 中止 egit 中的冲突 merge

标签 git egit

我最近在存储库 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. Choose hard 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/

相关文章:

git - merge 提交不会出现在 git rebase --interactive

Git merge 移动并重命名的文件

eclipse - 使用 Eclipse EGit 在 1and1 共​​享 Linux 服务器中克隆 1and1 git 存储库时出现问题

eclipse - 为什么不建议将 Eclipse 项目文件夹作为 Git 存储库?

git - 使用 git show 获取比给定修订更新的更改

git - .gitignore 无法忽略以前未缓存的文件

eclipse - 为团队编程设置 egit 存储库

java - eclipse 中的 Git Repositories 选项卡是空的

git - 在 GitHub 上可视化分支

git - git stash pop 成功后如何恢复我的 git stash