git合并的时候,冲突问题Merging is not possible because you have unmerged files

git合并分支错误,git融合分支错误,git merge错误,git冲突
git合并分支冲突,git ,git merge conflict error,git冲突,git如何融合分支
git合并冲突解决,git错误解决,git merge 冲突,git如何合并分支,git怎样融合分支

  • 在做项目工作的时候,同事修改了代码一个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 ” 备注信息 ” 提交,完成。

  • 23
    点赞
  • 53
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mynameislinduan

你的鼓励是我最大动力写博客不易

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值