在git pull的过程中,如果有冲突,那么除了冲突的文件之外,其它的文件都会做为staged区的文件保存起来。

重现:

$ git pull origin master

error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.

通过git status你会发现下面古怪的事情:

$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 7 different commits each, respectively.(use "git pull" to merge the remote branch into yours)You have unmerged paths.(fix conflicts and run "git commit")(use "git merge --abort" to abort the merge)Changes to be committed:modified:   CMakeLists.txtmodified:   builtin_op_importers.cppUnmerged paths:(use "git add <file>..." to mark resolution)both modified:   plugin_op/onnx_plugin/PRelu_Plugin.cuUntracked files:(use "git add <file>..." to include in what will be committed)debug/

本地的push和merge会形成MERGE-HEAD(FETCH-HEAD), HEAD(PUSH-HEAD)这样的引用。HEAD代表本地最近成功push后形成的引用。MERGE-HEAD表示成功pull后形成的引用。可以通过MERGE-HEAD或者HEAD来实现类型与svn revet的效果。

解决:

1.将本地的冲突文件冲掉,不仅需要reset到MERGE-HEAD或者HEAD,还需要–hard。没有后面的hard,不会冲掉本地工作区。只会冲掉stage区。

git reset --hard FETCH_HEAD

2.git pull就会成功。

Git 出错error: Pulling is not possible because you have unmerged files相关推荐

  1. git pull 报错:error: Pulling is not possible because you have unmerged files.

    报错: $ git pull error: Pulling is not possible because you have unmerged files. hint: Fix them up in ...

  2. git合并分支Pulling is not possible because you have unmerged files.

    问题:目前在master分支上,执行git merge 分支A 报错error: Pulling is not possible because you have unmerged files. 解决 ...

  3. error: Pulling is not possible because you have unmerged files

    git pull的时候出现如下的错误: 错误:无法提取,因为您有未合并的文件. 解决方案一(不推荐): 本地的push和merge会形成MERGE-HEAD(FETCH-HEAD), HEAD(PUS ...

  4. git pull报错Pulling is not possible because you have unmerged files

    git pull 报错 error: Pulling is not possible because you have unmerged files. 解决办法 1. git add -u 2. gi ...

  5. git pull 拉取代码的时候报错 Pulling is not possible because you have unmerged files.

    项目场景: git pull 拉取代码的时候报错 Pulling is not possible because you have unmerged files. 解决方案: 1. git add - ...

  6. Pulling is not possible because you have unmerged files

    Pulling is not possible because you have unmerged files 已经解决:请看error:failed to push some refs to 'xx ...

  7. 【git】git下拉项目Pulling is not possible because you have unmerged files解决方案

    ✨踩坑不易,还希望各位大佬支持一下\textcolor{gray}{踩坑不易,还希望各位大佬支持一下}踩坑不易,还希望各位大佬支持一下

  8. Pulling is not possible because you have unmerged files.

    git add . git commit -m '' git pull

  9. Couldnt check the working tree for unmerged files because of an error. bad signature index file cor

    git 提交代码 Couldn't check the working tree for unmerged files because of an error. bad signature 0x000 ...

最新文章

  1. 对于数据库连接池的一些思考和MyBatis的集成与使用
  2. 每日一皮:为什么程序猿是最适合谈恋爱的人
  3. 「12306奇葩验证码」反例背后的产品观
  4. Java 语法糖详解
  5. 揭开Python科学计算的面纱
  6. 用php生成HTML文件的类
  7. Redis哨兵的详解
  8. java 的 provider_Java里的Provider是什么?
  9. Redis教程:常见问题分析
  10. Atitit vm os内存管理 目录 1. 冯诺依曼结构、哈佛结构、改进型哈佛结构 1 1.1. 冯·诺依曼结构 1 1.2. 哈佛结构 2 1.3. 改进型的哈佛结构与哈佛体系结构差别 3 2.
  11. 06 - JavaSE之常用类
  12. 如何使用UMAP分析100维数据,惊艳令人叹为观止
  13. f2fs学习笔记 - 4. f2fs文件系统组件说明
  14. c语言中中不同类型数据间的混合运算
  15. 浅谈Spring事件监听
  16. c语言编程排球队员站位问题,排球比赛的站位技巧介绍,在比赛过程中该如何与队友沟通呢?排球比赛常见的手势说明...
  17. 基于FPGA和ABZ增量式编码器的转子位置检测
  18. Python爬虫进阶之爬取篮球赛数据
  19. Vue 移动端调用相机和相册实现图片上传
  20. EDAS投会议论文遇见的问题及部分解决办法——总结

热门文章

  1. win7系统mscomctl.ocx不能注册
  2. 【Python可视化展示】-多维数据可视化分析
  3. Flask邮件的配置和使用
  4. shineblink 紫外线测量
  5. Linux系统的grub.cfg文件损坏修复
  6. Zabbx6.0(学习笔记)
  7. jdk1.6升级jdk1.8踩出的神坑
  8. js实现表格列的位置拖拽
  9. MAXENT模型的生物多样性生境模拟与保护优先区甄选、自然保护区布局优化评估及论文写作技巧
  10. android项目飞机大战,Android 项目之飞机大战