Git提示You have not concluded your merge. (MERGE_HEAD exists)

Git原理

git fetch是将远程主机的最新内容拉到本地,用户在检查了以后决定是否合并到工作本机分支中。

git pull 则是将远程主机的最新内容拉下来后直接合并,即:git pull = git fetch + git merge,这样可能会产生冲突,需要手动解决。

解决方案

① 保存本地代码
② 执行git fetch --all,检查有无冲突
③ 执行git reset --hard origin/master ----> git reset 把HEAD指向刚刚下载的最新的版本
④ commit代码
⑤ psh代码


参考:

https://blog.csdn.net/daotiao0199/article/details/82757056

https://www.cnblogs.com/runnerjack/p/9342362.html

原文地址:https://www.cnblogs.com/aeolian/p/12516058.html