博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
svn 冲突处理
阅读量:4699 次
发布时间:2019-06-09

本文共 3609 字,大约阅读时间需要 12 分钟。

 

C:\workspace\test>svn upConflict discovered in 'test.txt'.

Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options:
svn detects that theres a conflict here and require you to take some kind of action.
If you type ‘s’ here you will get a list of the commands and meaning
如果你输入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
【选择处理方式一:df】
If you type ‘df’ it will show you a all the conflicts in the following format
选择选项df,则会按如下格式显示所有冲突
Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: df
--- .svn/text-base/test.txt.svn-base    Tue Aug 10 10:59:38 2010
+++ .svn/tmp/test.txt.2.tmp     Tue Aug 10 11:33:24 2010
@@ -1 +1,3 @@
-test
\ No newline at end of file
+<<<<<<< .mine +test User2 making conflict======= +User1 is making a conflict test>>>>>>> .r3
‘e’ option will open the conflicted file in the text editor that you configured for svn to use. In this case it will show
<<<<<<< .mine test User2 making conflict======= User1 is making a conflict test>>>>>>> .r3
You can resolve the conflict here by changing the text to what you desire.
For example:
你可以解决冲突通过改变文件内容,例如vim test.txt
User1 is making a conflict test User2 making conflict
save your changes and exit your text editor and it will give you the conflict options again. Now if you use the ‘r’ it will mark the file is merged with a ‘G’.  A status of ‘G’ means there was a conflict and it has been resolved.
保存更改,又出现刚才的选项。此时你使用r选项,则会合并文件。如下所示:
Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: e
Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: r
G    test.txt
Updated to revision 3.
you can now check the status with svn status. You see that test.txt is marked as ‘M’ all thats left to do is commit.
检查svn状态,你会发现文件test.txt前面已变成M
C:\workspace\test2>svn st
M       test.txt
C:\workspace\test2>svn ci -m "conflict resolved"
Sending        test.txt
Transmitting file data .
Committed revision 4.
【选择处理方式二:p】
Sometimes the conflicts are a bit more extensive and it requires more time or better tools to resolve the conflict in these cases you can chose ‘p’ to postpone the resolution.
有时,冲突会复杂一些,可能需要借助其他工具才能解决,这时你可以使用选项p
Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: p
C    test.txt
Updated to revision 3.
Summary of conflicts:
  Text conflicts: 1
Now if you look in your directory you will see that svn has created a few extra files for you.
此时,查看当前文件夹下,出现了如下几个文件
08/10/2010  11:44 AM                94 test.txt
08/10/2010  11:44 AM                26 test.txt.mine
08/10/2010  11:44 AM                27 test.txt.r2
08/10/2010  11:44 AM                31 test.txt.r3
The test.txt file is now a file with both User2 and User1′s changes but marked.
文件test.txt包含了用户1和用户2的更改。

转载于:https://www.cnblogs.com/uriel/p/5761641.html

你可能感兴趣的文章
KMP算法
查看>>
Atlas学习之开始篇[转]
查看>>
第二章 在HTML页面里使用javaScript
查看>>
【Educational Codeforces Round 48 (Rated for Div. 2) D】Vasya And The Matrix
查看>>
正则表达式的性能评测
查看>>
使用TopShelf做windows服务
查看>>
1026. 程序运行时间(15)
查看>>
NOIP 2018【摆渡车】题解
查看>>
Softmax函数
查看>>
Programming Ruby学习笔记一
查看>>
Surrounded Regions
查看>>
Django模板系统
查看>>
我的vim配置---jeffy-vim-v2.3.tar
查看>>
CentOS中TFTP配置
查看>>
使用mii-tool设置网卡速率
查看>>
通用窗口类 Inventory Pro 2.1.2 Demo1(中)
查看>>
英语中的将来完成时
查看>>
常用方法 保证数据长度相同
查看>>
在线画图工具
查看>>
OCA,OCP,OCM傻傻分不清?
查看>>