在创建分支更改了test.txt文件,git add 并且git commit后。
在master分支是上也更改了test.txt ,也add 和commit 后。
在分支合并时,git会提示冲突

并且查看文件 会出现
<<<<<<< HEAD
this is test.php
=======
this is test.txt
>>>>>>> show1
其中 <<<<<<< HEAD 和 ======= 之间是当前分支的最新版, ======= 和 >>>>>>> show1 之间是目标分支内容。
这里需要自己手动修改代码,保留自己想要的那份。然后重新git add 和 git commit ,再删掉分支即可。
网友评论