git合并冲突

git合并冲突

问题描述
复制代码
Auto-merging mes5server/mes5j.json
Auto-merging mes5server/mes5j.json
CONFLICT (content): Merge conflict in mes5server/mes5j.json
Automatic merge failed; fix conflicts and then commit the result.
原因

要合并的两个分支改动了同一份文件。

解决方法
  • 1.查看冲突文件

    git status

  • 2.查看冲突文件,=======上面是当前分支的代码,=======下面是要合并进来的分支代码,两者发生了冲突

    <<<<<<< HEAD
    你的本地代码

    从远程拉取的代码

    origin/master

  • 3.编辑冲突文件,决定保留哪些更改,然后删除冲突标记。

  • 4.标记文件为已解决冲突状态

复制代码
git add <file-with-conflict>
  • 5.解决冲突后提交修改

    git commit -m "提交信息"

  • 6.再次尝试拉取

    git pull origin master

将远程origin主机的master分支拉取过来和本地的当前分支进行合并

相关推荐
番茄不是西红柿kk7 小时前
deepseek-harness跨平台桌面端二开项目(附git仓库地址+安装包)
git·agent·codex·deepseek·deepseekharness
leoZ23110 小时前
10-Git 仓库蒸馏术:从代码仓库到 OpenClaw 虚拟人-蒸馏工具链
大数据·git·深度学习·神经网络·目标检测·elasticsearch·lstm
fpcc1 天前
工具使用—git diff命令分析说明
git·工具
console.log('npc')1 天前
Git 删除指定提交记录操作指南
git
随风丶飘1 天前
[特殊字符] 告别“update“和“fix bug“——Smart Git Commit LLM 让 AI 帮你写专业的 Git 提交信息
人工智能·git·bug
yanlaifan1 天前
git clone时候指定换行符
git
小小安于乱1 天前
解决IDEA的git插件pull代码冲突但右下角不提示消息问题
java·git·intellij-idea
ITKEY_1 天前
git 命令行操作回退到指定版本
git
New_Horizons6661 天前
Git 操作(使用git-commit-template)
git
慕容引刀1 天前
或许你真的需要这个Git神器:让团队提交文案终于对齐了
人工智能·git·vscode·自然语言处理·github