gpt4 book ai didi

git -- 如何从未完成的 merge 中恢复

转载 作者:太空狗 更新时间:2023-10-29 13:58:54 24 4
gpt4 key购买 nike

我启动了 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com