Git 基础 - 冲突解决
- 从本地master分支创建dev分支
- 从本地master分支创建dev1分支
- 在dev分支修改 READM.md 文件,并添加到暂存区
- 在dev1分支修改 READM.md 文件,并添加到暂存区
[@wooluwalkerdeMacBook-Pro:wenjian (dev)]$ git ci -m‘dev修改READM.md‘ #dev分支的修改提交 [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ git ci -m‘dev修改README.md‘ #dev1分支的修改提交 [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ git merge dev #将本地dev分支合并到本地dev1分支,产生了冲突 Auto-merging README.md CONFLICT (content): Merge conflict in README.md Automatic merge failed; fix conflicts and then commit the result. [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ cat README.md # 冲突文件,等号上方为当前分支dev1内容,下方为被合并分支dev的内容 <<<<<<< HEAD dev1修改的内容 ======= dev修改的内容 >>>>>>> dev [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ vim README.md # 编辑冲突文件 [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ cat README.md # 编辑后的冲突内容 dev修改的内容 [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ git ci -m‘解决dev和dev1的README.txt合并冲突‘ [dev1 fb7abce] 解决dev和dev1的README.txt合并冲突 [@wooluwalkerdeMacBook-Pro:wenjian (dev1)]$ git dog * fb7abce (HEAD -> dev1) 解决dev和dev1的README.txt合并冲突 |\ | * fab7157 (dev) dev修改READM.md * | 9e782b0 dev修改README.md |/ * 217fef2 (origin/master, origin/HEAD, master) Update README.md,添加日期 * a565481 (origin/dev) Update README.md * 19cfeea 第一次将远程dev分支代码合并到master分支Merge branch ‘dev‘ |\ | * b1777d8 commit merge_excel_utils | * ee37473 manage utils | * 0b6e16c commit files * | 441940f 添加项目说明 |/ * 0f1f9d7 Initial Commit # 即可将dev1或dev push到远程
相关推荐
兄dei努力赚钱吧 2020-09-06
huangchunxia 2020-07-08
nebulali 2020-07-05
lovetg0 2020-05-31
tianhuak 2020-11-24
86276537 2020-11-19
大牛牛 2020-10-30
flycappuccino 2020-09-27
卢从利 2020-10-10
无忧老猪 2020-10-09
学峰的学习笔记 2020-10-05
85216033 2020-09-16
89334799 2020-08-12
ruanhongbiao 2020-08-16
邓博学习笔记 2020-08-03
ningningmingming 2020-07-28
zhongzhiwei 2020-07-27
Jiajinjin 2020-07-27