git合并的时候,冲突问题Merging is not possible because you have unmerged files
在做项目工作的时候,同事修改了代码一个cpp代码,我同样也修改了代码,两人代码冲突了,提交之后,他代码git自动合并,并提示: [master| MERGEING]
$ git merge my_new_branch
error: Merging 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.
又或者提示如下错误:
Auto-merging src/ui/menu/wizardGroup.c
Auto-merging src/ui/menu/drawmenu5.c
Auto-merging src/ui/menu/drawmenu3.c
Auto-merging src/ui/menu/drawmenu2.c
Auto-merging src/ui/menu/drawmenu1.c
Auto-merging src/ui/menu/drawmenu0.c
Auto-merging src/string/language_d.h
CONFLICT (content): Merge conflict in src/string/language_d.h
Auto-merging src/string/languageDict.h
CONFLICT (content): Merge conflict in src/string/languageDict.h
Auto-merging src/drawui.c
Auto-merging src/dev/dev_phascan.c
Auto-merging src/dev/dev_flexscan.c
Auto-merging src/callback.c
Automatic merge failed; fix conflicts and then commit the result.
* 解决方法:
If you have fixed the conflicts you need to add the files to the stage with git add [filename], then commit as normal.
就是你手动修改git提示有错误的文件,修改之后,添加有冲突的文件: git add [被修改的冲突文件], 最后,按照普通提交那样,提交有冲突的问题: git commit [修改后的冲突文件] -m “注释内容”
*简单的来说就是:
用git diff或者git status 查看哪些文件冲突,有冲突的会提示:
++<<<<<<< HEAD
++<<<<<<< new_branch
修改你的冲突的文件,修改完之后,保存。
用git add xxx,把你修改的文件全部都添加进去。
最后,用git commit -a -m ” 备注信息 ” 提交,完成。
最新文章
- mysqldump 备份命令使用中的一些经验总结
- 【leetcode】Candy(hard) 自己做出来了 但别人的更好
- HDU1063 大数 java
- objective c实现配置文件+反射
- CSS 高级技巧汇总
- easyui-validatebox 验证两次密码是否输入一致
- LB负载均衡集群及NAT模式配置
- MongoDB 学习笔记(二)—— MongoDB Shell
- Storm系列(三)Topology提交过程
- freemarker list (长度,遍历,下标,嵌套,排序)
- HTTP发送请求模拟
- lightoj1336数论基础
- #417 Div2 B
- 【LeetCode】306. Additive Number
- hadoop2.6.0实践:A01 问题处理 DEPRECATED: Use of this script to execute hdfs command is deprecated.
- PHP MySQL Order By 关键词
- JSSDK调用微信原生的功能上传图片保存到自己的服务器中
- Letters Removing CodeForces - 899F (线段树维护序列)
- 学会学习:高效学习方式(使用vscode-snippet有感)
- Shell编程(六)awk工具
热门文章
- 001_Eclipse编写第一个Java程序
- DDD领域模型企业级系统Linq的CRUD(四)
- prometheus如何使用blackbox-exporter来获取k8s的网络性能
- mysql 主键与外键
- 高能天气——团队Scrum冲刺阶段-Day 3
- Git公钥/私钥生成方式
- bzoj4001: [TJOI2015]概率论
- UVALive 7146 (贪心+少许数据结构基础)2014acm/icpc区域赛上海站
- BZOJ2888 : 资源运输
- mysql_提示 Lock wait timeout exceeded解决办法