22.合并冲突
实验
制造冲突
# 切换到新分支
git checkout lgnew
# 编辑test文件,添加一行内容 123,并提交
cat .\lab\test.txt
abc
123
git commit -a -m "added 123 to the test.txt"
# 切换回主分支
git checkout master
# 编辑test文件,添加一行内容 456,并提交
# 编辑test文件,添加一行内容 123,并提交
cat .\lab\test.txt
abc
456
git commit -a -m "added 456 to the test.txt"
# 合并
git merge lgnew
Auto-merging lab/test.txt
CONFLICT (content): Merge conflict in lab/test.txt
Automatic merge failed; fix conflicts and then commit the result.合并冲突
Last updated