如果你输入s选项,则会列出所有svn解决冲突的选项,如下所示:
(e) edit - change merged file in an editor #直接进入编辑
(df) diff-full -show all changes made to merged file #显示更改至目标文件的所有变化
(r) resolved -accept merged version of file
(dc) display-conflict -show all conflicts(ignoring merged version) #显示所有冲突
(mc) mine-conflict -accept my version for all conflicts (same) #冲突以本地为准
(tc) theirs-conflict -accept their version for all conflicts (same) #冲突以服务器为准
(mf) mine-full -accept my version of entire file (even non-conflicts) #完全以本地为准
(tf) theirs-full -accept their version of entire file (same) #完全以服务器为准
(p) postpone -mark the conflict to be resolved later #标记冲突,稍后解决
(l) launch -launch external tool to resolve conflict
(s) show all -show this list
一般我们会选择p稍后解决冲突,这样会生成三个文件:.mine, .rOLDREV, .rNEWREV。
比如:index.html index.html.mine index.html.r1 index.html.r2
解决冲突方法大致有一下几种:
1).手工修改index.html文件,然后将当前index.html作为最后提交的版本
svn resolve index.html –-accept working
2).选择base版本,即index.html.rOLDREV作为最后提交的版本
svn resolve index.html –-accept base
3).使用index.html.rNEWREV作为最后提交的版本
svn resolve index.html –-accept theirs-full
4).使用index.html.mine作为最后提交的版本
svn resolve index.html –-accept mine-full
# 或者用下面这条命令也可以
svn resolve index.html –-accept theirs-conflict