我启动了 mergetool ...
> git mergetool
它说了类似...
merge tool candidates: blah blah blah
Merging:
file1.c
然后我想,“你知道,我还没准备好。”不知道有什么干净的方法可以关闭它,我按了 ctrl-C。现在我想检查另一个分支,但我不能...
> git checkout other_branch
error: path 'file1.c' is unmerged
有什么方法可以从中恢复吗?我要强调的是,我在 mergetool 运行时没有进行任何实际更改。
最佳答案
你正在寻找存在于大多数 git 命令中的 --abort
选项:
git merge --abort
手动输入:
Abort the current conflict resolution process, and try to reconstruct the pre-merge state.
关于git -- 如何从未完成的 merge 中恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40666400/