You have not concluded your merge (MERGE_HEAD exists)

简介: You have not concluded your merge (MERGE_HEAD exists)

Git提交报错:error:You have not concluded your merge (MERGE_HEAD exists)


原因:pull下来的以前代码自动合并失败


解决


方法一:保留本地的更改,中止合并->重新合并->重新拉取

git merge --abort
git reset --merge
git pull
# git pull之后然后重新解决冲突,再push


方案二:远端版本覆盖本地版本(慎重)


git fetch --all
git reset --hard origin/master
git fetch


Git fetch和git pull的区别


  • git fetch:只是从远程获取最新版本到本地,不会merge(合并)
  • git pull:从远程获取最新版本并merge(合并)到本地 —相当于进行了 git fetch 和 git merge两部操作
# 切换分支
git checkout master
# 查看本地及远程分支
git branch -a
# 查看远程分支
git branch -r
# 查看本地分支
git branch
# 删除远程dev分支
git push origin --delete dev
# 删除本地dev分支
git branch -d dev
# 对比本地与远程test分支
git diff test
# 合并分支
git merge test


目录
打赏
0
0
0
0
71
分享
相关文章
DROP INDEX
【11月更文挑战第16天】
112 2
You have not concluded your merge (MERGE_HEAD exists)
You have not concluded your merge (MERGE_HEAD exists)
Leetcode 623. Add One Row to Tree
题目很简单,在树的第d层加一层,值为v。递归增加一层就好了。代码如下
66 0
git报错,error: You have not concluded your merge (MERGE_HEAD exists). hint: Please,
git报错,error: You have not concluded your merge (MERGE_HEAD exists). hint: Please,
285 0
【1089】Insert or Merge (25 分)
先模拟直接插入排序的每一趟的过程,并进行判断每一趟的序列和给出的第二个序列是否相同,若不相同则一定是归并排序,直接对第一个序列进行归并排序一趟并输出。 (1)归并排序可以使用非递归版本(更少);
113 0
1089. Insert or Merge (25)
#include #include #include using namespace std; int main(){ int n; cin >> n; vector a(n), b(n); ...
839 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等