git pull 报错 MERGE_HEAD exists

git pull 时,出现如下报错信息:

1
2
3
error: You have not concluded your merge (MERGE_HEAD exists).  
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.

产生这个错误的原因可能是:以前 pull 下来的代码自动合并失败。解决方法:

  • 方法一:放弃本地修改,直接覆盖。git reset --hard 以及 git pull
  • 方法二:先 commit 然后再 pull 或 merge。

git pull 报错 MERGE_HEAD exists

https://blog.xiang578.com/note/202404111048.html

作者

Ryen Xiang

发布于

2024-04-11

更新于

2024-04-19

许可协议


网络回响

评论