Fork me on GitHub

Git学习 -- 冲突解决


当连个分支对统一文件提交了不同修改时,可能会出现冲突,例如:

$ git merge feature1
Auto-merging readme.txt
CONFLICT (content): Merge conflict in readme.txt
Automatic merge failed; fix conflicts and then commit the result.

 

此时参看冲突的文件发现,Git用<<<<<<<=======>>>>>>>标记出不同分支的内容,修改成一致后保存

 

重新add和commit

重新merge

 

删除分支

 

 

使用带参数的git log命令也可以看到分支的合并情况 

  git log --graph --pretty=oneline --abbrev-commit

 

 

posted @ 2015-10-22 16:42  Roronoa__Zoro  阅读(123)  评论(0编辑  收藏  举报