解决合并过程中产生的冲突问题

制造一个冲突

1.输入ll回车
2.输入vim test.txt回车,按i键
3.输入内容"这个是master分支上的添加的内容",按Esc键,输入:wq退出vim模式
4.输入git add test.txt回车
5.输入git commit -m “master分支增加内容"回车
6.输入git push回车
7.输入cat test.txt回车
8.输入git checkout mergedemo回车
9.输入cat test.txt回车
10.输入vim test.txt回车,按i键
11.输入内容"这是mergedemo分支上添加的内容”,按Esc键,输入:wq退出vim模式
12.输入git add test.txt回车
13.输入git commit -m "mergedemo分支上添加内容"回车
14.输入git push回车
15.输入cat test.txt回车
16.输入git checkout master回车
17.输入cat test.txt回车
在这里插入图片描述
在这里插入图片描述

合并分支,解决冲突

1.输入git merge mergedemo回车
2.输入cat test.txt回车
注:出现冲突,内容多了一些<<<< HEAD,,>>>>> mergedemo
3.输入vim test.txt回车,按i键
4.内容把<<<< HEAD,
,>>>>> mergedemo去掉,按Esc键,输入:wq退出vim模式
5.输入git add test.txt回车
6.输入git commit -m "解决合并冲突"回车
7.输入git push回车
8.输入cat test.txt回车
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42884654/article/details/82824424