git merge 后出现问题:无法拉取,因为未完成合并并且没有暂存文件

发布于 2025-01-15 15:07:25 字数 636 浏览 2 评论 0 原文

我已经将一个分支合并到 GitHub 上的 master 上,然后想在本地进行 git pull 。当我执行 git pull 时,它要求我提交更改,因此我添加了文件并提交。

但是发生了一些事情,尽管合并已经完成,但我还是陷入了合并的中间。我有一个空的暂存区,当我尝试执行 git pull 时,出现此错误:

❯ git pull
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
❯ git pull --force
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.

在我在控制台中按分支名称写入的行上

master merge 

有人可以告诉我这里发生了什么以及如何解决此问题吗? 谢谢。

I have merged a branch to master on GitHub and wanted to do a git pull locally after that. When I did a git pull it asked me to commit changes, so I have added files and committed.

But something happened, and I am stuck kind of in the middle of the merge, although the merge is completed. I have an empty staging and when I try to do a git pull I get this error:

❯ git pull
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
❯ git pull --force
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.

and on the line where I write in the console by the branch name I have

master merge 

Can someone tell me what is happening here and how to solve this problem?
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆里有你的影子 2025-01-22 15:07:25

您是否尝试过 git merge --abort 并尝试再次拉取?

来自 www.git-tower.com 关于合并冲突

您应该始终记住,您可以随时返回到开始合并之前的状态。这应该会让您确信自己不会破坏任何东西。在命令行上,一个简单的 git merge --abort 将为您完成此操作。

另请参阅您尚未完成合并(MERGE_HEAD 存在)

Have you tried git merge --abort and tried to pull again?

From www.git-tower.com about merge-conflicts:

You should always keep in mind that you can return to the state before you started the merge at any time. This should give you the confidence that you can't break anything. On the command line, a simple git merge --abort will do this for you.

See also You have not concluded your merge (MERGE_HEAD exists)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文