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


相关文章
|
8月前
【Stata】append和merge的区别
【Stata】append和merge的区别
221 0
|
8月前
|
开发工具 git
You have not concluded your merge (MERGE_HEAD exists)
You have not concluded your merge (MERGE_HEAD exists)
|
11月前
|
开发工具 git
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,
101 0
【1089】Insert or Merge (25 分)
先模拟直接插入排序的每一趟的过程,并进行判断每一趟的序列和给出的第二个序列是否相同,若不相同则一定是归并排序,直接对第一个序列进行归并排序一趟并输出。 (1)归并排序可以使用非递归版本(更少);
81 0
|
人工智能 BI
1089. Insert or Merge (25)
#include #include #include using namespace std; int main(){ int n; cin >> n; vector a(n), b(n); ...
802 0
|
SQL 关系型数据库 Oracle